Я скачал UIPopOverListView из GitHub, и вставил в моем рабочем пространстве, то при нажатии на кнопке, появится popoverlistview, но делегаты и методы DataSource называются, но не работают должным образом,
Когда моя кнопка нажатаДелегаты и источник данных не работают для UIPopoverListView в iOS?
-(void) effectsButtonClicked
{
effectsPopView = [[UIPopoverListView alloc] initWithFrame:CGRectMake(10,150,300,200)];
effectsPopView.delegate=self;
effectsPopView.datasource=self;
effectsPopView.listView.scrollEnabled = FALSE;
[effectsPopView setTitle:@"Effects"];
[effectsPopView show];
}
Тогда мой datasouce и делегаты
#pragma mark - UIPopOverListView DataSource
- (NSInteger)popoverListView:(UIPopoverListView *)popoverListView
numberOfRowsInSection:(NSInteger)section
{
return 5;
}
- (UITableViewCell *)popoverListView:(UIPopoverListView *)popoverListView
cellForIndexPath:(NSIndexPath *)indexPath
{
static NSString *identifier = @"cell";
UITableViewCell * effectsCell= [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:identifier];
effectsArray=[NSArray arrayWithObjects:@"Black and White",@"Sepia",@"Hue",@"Snow",@"Normal", nil];
effectsCell.textLabel.text=[effectsArray objectAtIndex:indexPath.row];
effectsCell.textLabel.textColor=[UIColor redColor];
NSLog(@"%@",effectsArray);
return effectsCell;
}
#pragma mark- UIPopoverList Delegates
- (void)popoverListView:(UIPopoverListView *)popoverListView
didSelectIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"ROw selected");
}
снимок экрана
Может кто-нибудь объяснить, почему DataSource и делегаты не работают