UISplitViewController Cannot Change the Master View Controller?

Posted by Nex on Stack Overflow See other posts from Stack Overflow or by Nex
Published on 2010-05-04T08:12:02Z Indexed on 2010/05/04 10:18 UTC
Read the original article Hit count: 363

I am trying to change the master view controller (that appears in the popover in portrait, and on the left side in landscape) in a UISplitViewController. I'd like to switch between the master view controller being one of two different UIViewControllers (depending on an action taken elsewhere in my application).

I am using the following:

mySplitViewController.viewControllers = [NSArray arrayWithObjects:newMasterController, detailController, nil];

This correctly changes the master viewcontroller as you would expect in landscape mode. However it does not seem to change the viewcontroller used for the popover in portrait mode.

I notice that the barbuttonitem to show this master view controller is just calling showMasterInPopover: on the splitviewcontroller, and so would expect it to work in portrait mode as well, but it does not.

In fact, I can set the master view controller, see the new viewController correctly in landscape mode, rotate back to portrait, and the viewcontroller used in the popover is still the old one.

Is this a bug?

© Stack Overflow or respective owner

Related posts about uisplitviewcontroller

Related posts about ipad