tags:

views:

75

answers:

2

I've been working on an iPad application that has about 15 view controllers. Some of the view controllers are full screen, others are embedded inside the other view controllers (think split view controller).

On the iPhone navigation is very straight forward. Even if you have a ton of view controllers, you are using one of Apple's root view controllers (tab or navigation). The navigation is handled by the root view controllers and you are pretty much free to focus on your views.

On the ipad the split view and tab view controllers are not always useful, and for the app I'm working on they do not cut it. I have created separate navigation controller objects to handle hiding/show view controllers based on notifications that get posted when the user performs actions.

Anyone else have experience with solving the navigation problem on the iPad?

+1  A: 

have you checked out MGSplitViewController by Matt Gemmell?
http://mattgemmell.com/2010/08/03/mgsplitviewcontroller-updated

I'm not claiming it'll solve all your navigation problems, but it's an interesting idea and may help you in finding more/better ways of handling view controllers.

Jasarien
Thanks for the info. I had read about this a while back, but didn't look into it. Will do that now, thanks!
logancautrell
A: 

Also, be careful using multiple view controllers for views which don't fill the full screen. Apple's documentation explicitly states that you shouldn't use view controllers for partial-screen views:

Note: You should not use view controllers to manage views that fill only a part of their window—that is, only part of the area defined by the application content rectangle. If you want to have an interface composed of several smaller views, embed them all in a single root view and manage that view with your view controller.

http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html

Although some things might work when you have multiple view controllers managing different sub-views, other things won't work. For example, only one of your view controllers will be informed when the device is rotated. Likewise, not all your view controllers will be sent 'viewWillAppear' 'viewDidUnload' etc messages that you might expect.

Jake
That documentation was written pre iPad. It really isn't realistic to make all your screens separate view controllers on the iPad. In any non-trivial app there is simply too much going on for a single view controller to handle all the views. While you do have to manually handle some methods like viewWillAppear:, memory management related methods *are* still invoked properly.
logancautrell