views:

70

answers:

1

I want to have multiple views in my application that I switch between.

What is the proper way to switch between UIViews that also supports UISplitViewController? Is there a support way to switch or are Apple's controller classes designed to be root and root only?

I've tried having one root view and root controller and swap subviews in and out. One of the subviews is a UISplitViewController. It did not like the arrangement and does not display correctly. The detail view was not displayed, the master view displayed wrong orientation and wrong size.

I've then tried managing adding and removing one subview from the UIWindow in the app delegate. This works most of the time. However, the views added after the applicationDidFinishLaunching method do not appear setup correctly. They mostly look correct, however sometimes the orientation thinks its portrait when in reality its landscape. Also, when I try to display a popover, it shows up in an incorrect location. If I change the orientation, it redraws correctly. I've also have some random instances where the UISplitViewController view does not fully display, as if its frame is incorrectly sized.

Any suggestions heartily appreciated.

A: 

In applicationDidFinishLaunching, your objects haven't completed loaded from NIBs yet. Try using a viewDidLoad method instead.

What is the user-interface for switching between views? If one of these views represents a transient mode that the user enters and then exits, consider using a modal view. (See presentModalViewController:animated:.)

I would need more details about what you're doing to answer more particularly.

David M.
Its behaving the opposite of what you describe. One view loaded during applicationDidFinishLaunching works correctly. If instead, you add that view to the window AFTER applicationDidFinishLaunching, such as with a perform selector after delay, it appears confused regarding orientation and frame.
David
Fundamentally, I'm trying to swap out a UISplitView any way I can. I haven't found a way yet. Usually the issue is that while the iPad is physically oriented landscape, subviews think its portrait.
David