iOS popovers - View lifecycle.
iOS popovers - View lifecycle.
- Subject: iOS popovers - View lifecycle.
- From: Alex Zavatone <email@hidden>
- Date: Fri, 07 Sep 2012 10:39:13 -0400
iOS 5.0.1
I just noticed that when we open a popover ala a segue, that after it is dismissed, when it is opened again, none of the view lifecycle methods are called.
viewWillAppear, viewDidAppear both don't get called, but it appears just fine.
Is this expected behaviour?
Does presentPopoverFromBarButtonItem need to be trapped to get the methods that I expected to be called get called?
What we're using to handle popover display from a barButtonItem is this:
- (IBAction)popoverButtonWasClicked:(id)sender {
if(popoverViewController){
if([self.popoverViewController isPopoverVisible]){
// dismiss popover and do search
[popoverViewController dismissPopoverAnimated:YES];
// do search
[self performQuery];
self.filtersPopoverButton.title = @"Filters Menu";
}
else{
[popoverViewController presentPopoverFromBarButtonItem:sender permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
self.filtersPopoverButton.title = @"Perform Search";
}
}
else
{
[self performSegueWithIdentifier:@"Filters Popover" sender:sender];
self.filtersPopoverButton.title = @"Perform Search";
}
}
Sure, I can explicitly call [popoverViewController viewWillAppear] from the above method, but it seems really strange that the methods don't get called the second time the popover is displayed.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden