I’m trying to change the detail view in a splitViewController, i have the UIViewControllerHierarchyInconsistency exception when i do
self.detailView.view=view.view;
I’ve controlled if there are other viewControllers in xib files and i also used method removeFromParentViewController, but i’ve the same exception.
The error is only in iOS 6 but not in iOS 5, in iPad simulator.
I’m trying to change the detail view in a splitViewController, i have the UIViewControllerHierarchyInconsistency
Share
Is your splitViewController an instance of UISplitViewController?
http://developer.apple.com/library/ios/#documentation/uikit/reference/UISplitViewController_class/Reference/Reference.html
If so, you’re doing something fundamentally wrong. The UISplitViewController is simply a container for two view controllers, a master view controller and a detail view controller. It is then up to your view controller to decide how to deal with interactions and such. removeFromParentViewController is only used in View Controller Containment, and as such doesn’t seem applicable here.
Read the documentation in the link above to see if it meets your needs, but if I understand, you need to set your view controllers in the split view, not your views.
To do you, you need to do:
If this isn’t applicable, then please provide your code so that a correct solution can be made. Your descriptions have been rather vague as to what you’re actually doing.