views:

716

answers:

2

I am trying to implement a split view controller like UISplitViewController on the iPad, but I don't want the left pane to be hidden when the device is in portrait orientation.

So I've created a UIViewController subclass for this in IB and it works fine without any sub-view controllers. Now I'm trying to wrap my head around what is required to setup and manage the two UIViewController objects for the left and right panes. In my app, they are going to both be UINavigationController with a UITableView in them.

I've hit a mental road block about how to set this up and was hoping someone could point me to some sample code or give me a recommendation for architecture here...

+2  A: 

The only reason to use the UISplitView controller is the show/hide logic it gets you for free. I would think it a lot easier to simply take the two view controllers (Root View & Detail View) and lay them on a standard UIViewController. You can then manage them more diorectly without overriding the intended behavior of the implemented controller.

THe settings app on the iPad does what you are looking for and I believe this is the approach that app takes.

Good Luck!

MystikSpiral
+2  A: 

Create your UISplitViewController instance and then call:

 [splitViewController setHidesMasterViewInPortrait:NO];

The compiler will give you a warning message but it will do what you want. You can get rid of the compiler warning by making a category on UISplitViewController that implements that method.

Atomic John