views:

86

answers:

2

I am trying to manage 18 different views. How can I handle next-previous functionality for each view in an efficient way with this many views?

A: 

Do you see any issues managing those views in standard way?

I assume you create each view either from nib or pragmatically. You use UINavigatorController and/or UITabBarController and you add views, for tab bar controller as an array for navigator controller you pop up the first view and setup callback methods.

Other views are pushed/popped as user navigates UI. I believe that UINavigationController will unload views if there's not enough memory and load it back when needed.

If you postpone all the hard work until when the data are needed then you should be ok - unless you hit some limits but I can't tell since there's not enough details about what is in those views - complex data, images ...

stefanB
A: 

The easiest way to manage all this is to create a class that derives from UIViewController and have it implement a show and a hide delegate method. Then have all your viewcontrollers derive from this class and override for any sort of custom behavior.

This way, each screen has a consistent way to go to the next view and a consistent way to return the results back to the caller.

How you navigate between views is based on what you're doing. A NavController is a good way to go through a hierarchy or take the user on a step-by-step procedure. A modal dialog works when you need the user to enter something before you can proceed.

But with a standard show/hide interface it should make it easier to manage the flow between screens.

Ramin