i want to show a my Popover with a TableView just from the beginning, when the app loads. Problem is that the tableView doesn't have any content then. I am using that method:
UIBarButtonItem *barItem = [self.toolbar.items objectAtIndex:0];
[self.popoverController presentPopoverFromBarButtonItem:barItem permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
Now, my idea was to have a delegate method which is fired when the tableView finished fetching the data, but unfortunately nothing happens:
RootViewController.h
:
@protocol RootDelegate <NSObject>
@optional
-(void)didFinishLoading;
@end
RootViewController.m
:
- (void)viewDidLoad
{
[super viewDidLoad];
[self.tableView initWithFrame:self.tableView.frame style:UITableViewStyleGrouped];
self.clearsSelectionOnViewWillAppear = NO;
[self setTitle:@"Zielscheiben"];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(dataSaved:) name:@"DataSaved" object:nil];
[[self delegate] didFinishLoading];
}
DetailViewController.m
(conforms to the protocol)
- (void)didFinishLoading
{
UIBarButtonItem *barItem = [self.toolbar.items objectAtIndex:0];
[self.popoverController presentPopoverFromBarButtonItem:barItem permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];
}