我在使用 UIPopover 内的 TableView 时遇到了一些困难,该表只是空的,即使它是一个静态表视图。
代码:
- (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];
}
}
附上截图: