在UIPopover的空表视图

时间:2012-09-05 13:46:24

标签: objective-c ios ipad uitableview uipopovercontroller

我在TableView insite UIPopover上遇到了一些困难,表格只是空的,即使它是静态表视图。

代码:

- (IBAction)settingsBtnPressed:(id)sender {
if(self.pop.isPopoverVisible) {
    [self.pop dismissPopoverAnimated:YES];
} else {
    //SettingsViewController *s = [[SettingsViewController alloc] init];
    SettingsViewController *s = [self.storyboard instantiateViewControllerWithIdentifier:@"settings"];
    s.brain = self.brain;
    self.pop = [[UIPopoverController alloc] initWithContentViewController:s];
    [self.pop setPopoverContentSize:CGSizeMake(400, 500)];
    [self.pop presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}
}

附上截图:

Grouped static table view controller defined in IB. Result I'm getting.

2 个答案:

答案 0 :(得分:1)

您是否实施了cellForRow:atIndex:numberOfSections:inTableView:numberOfRows:inSection等方法?

答案 1 :(得分:0)

也许您没有在头文件中使用UITableViewController而是使用UIViewController