views:

575

answers:

2

I am trying to develop an app which can have multiple views (up to 30). Each view will have have similar navigation but the content will be different. Do I have to create 30 view controllers or can I get around by creating a view controller for the data (content) alone. I am sure creating multiple view controllers is going to be inefficent. I will be using the UINavigationController for sure.

Any information, links would be really appreciated.

Thanks

Amy

+3  A: 

One view should be enough. Similar to Contacts application you have table view with each row containing different contact but when you select a name you are shown view with the details of the specific contact.

The view is the same for every contact but the data are specific for the contact. You reuse the same view but you populate it with different data.

More info on UINavigationController and UIViewController in View Controller Programming Guide for iPhone OS.

stefanB
A: 

You can place a UIView in the center part of your window for the content. This view should fill the space not taken up by your navigation bar. You can then switch the content in this view by adding a subview to it or by changing the content inside.

Dan Lorenc