I have an application with a UISplitViewController, when I launch the app under potrait mode it's missing the "Group" UIBarButtonItem. I need to turn to landscape mode and back to potrait to make it appear. When I launch it in landscape mode it is there. Here's some screenshot to make it clear:
This is when the application is launched at portrait mode
This is in landscape mode, after rotating it from portrait mode:
This is after rotating back to portrait mode from landscape mode:
The same thing happened to me a couple days ago. You just have to make sure that the detail view is delegate of the splitView. If you try to set the delegate in the detail view's viewDidLoad
, it won't be set until after the splitView loads (with the root tableView controller). That is why it is doesn't get placed until you switch to landscape and back. The best way to set the delegate is either in your app delegate implementation file (when you create the UISplitViewController, which would be the best idea) or in the root tableView controller with something like
- (void)viewDidLoad {
self.splitViewController.delegate = [self.splitViewController.viewControllers objectAtIndex:1];
}
That makes the detail view delegate, so when it loads after the tableView controller loads, it will call your splitViewController:willHideViewController:...
method.
Of course, this may not be the situation you have. I'm just assuming that since I had the exact same behavior, it is probably the same cause. If this doesn't do the trick, just say so and we'll get to the cause
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With