When I trying to add SplitViewController to view hierarchy application terminates with:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIPopoverController initWithContentViewController:] must not be called with nil.'
SplitViewController *viewController = [[SplitViewController alloc] init];
[self.window addSubview:viewController.view];
Where SplitViewController subclass of UISplitViewController
I don't understand which popover it means. This trouble appear only on iOS5.
After initializing viewController, you should set its viewControllers with viewController.viewControllers = [NSArray arrayWithObjects:leftNavigationController, rightNavigationController, nil];
Else, your SplitViewController does not know what to display on the left and on the right.
Pay attention also to the delegate.
Please check if this helps :)
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