views:

505

answers:

2

I have the following setup:

  • A subclass of UISplitViewController that creates the master and detail view controllers in the constructor.
  • Master and Detail view controllers that both override shouldAutorotateToInterfaceOrientation to return `YES'.
  • Detail view controller implements the UISplitViewControllerDelegate protocol and deals with the popover.

I am observing two weird issues that might be interrelated:

  1. When the split view comes up (in portrait mode - default on simulator), the Master view is visible. It should not be.
  2. When I rotate the simulator, the view does not "right" itself.

My UISplitViewController subclass does not override shouldAutorotateToInterfaceOrientation. However, both master and details view controllers do and return YES.

Any ideas what I might be doing wrong? Is this a simulator bug?

Thanks.

-Raj

A: 

My UISplitViewController subclass does not override shouldAutorotateToInterfaceOrientation

Have you tried this? Does it work?

Jeff Kelley
Yes, I had it overridden to return a YES. Did not help.
This looks like a simulator bug. I set a breakpoint in my UISplitViewControllerDelegate's willHideViewController method. It gets called when the app first runs. Thereafter, none of the delegate methods that deal with rotation get called. There is no exception trace in gdb.
Do you have a real device to test on, to see if it's the same?
Tom H
A: 

For anyone else who lands here: This was happening because my split view controller's view was not the root. This is absolutely required.