My iPad app uses the standard UISplitViewController. My problem is, if I
- Rotate to portrait, I put a Popover button for the Master list - Fine
- Select an item via the popover, that changes the detailview (This uses a
prepareForSegue
which setsself.splitViewController.delegate = newViewDetailViewController;
- The resulting detailview is now missing a popoverbutton. If I rotate to landscape, the master list appears. If I then again rotate to portrait, a popoverbutton appears.
So - How can I ensure willHideViewController
will be called on viewDidLoad
, for example?
I can detect what the orientation is, but I still need the barbuttonitem and popovercontroller needed in
- (void)splitViewController:(UISplitViewController *)splitController willHideViewController:(UIViewController *)viewController withBarButtonItem:(UIBarButtonItem *)barButtonItem forPopoverController:(UIPopoverController *)popoverController
For now I am following Apples MultipleDetailView example as suggested here.
But since I am having multiple MasterControllers as well, it's a real hassle to store (a static) pointer to the popoverbutton item and setting it every time I push a level on my masterview controller.
Hopefully, someone has a good way of solving this problem :-)
willHideViewController
method. So, I have aSubstitutableDetailViewController
protocol that my detail views implement. – CracyDSubstitutableDetailViewController
protocol. It doesn't receive(void)splitViewController:(UISplitViewController*)svc willShowViewController:(UIViewController *)aViewController invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem
when the view controller was loaded before and rotated when it was not visible. – avance