Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Switching to a possible 10 views - how many view controllers?

Posted on 2010-09-01
1
Medium Priority
?
537 Views
Last Modified: 2013-11-25
I'm writing a "guide" style app which will display static content dependant on what category the user selects. From the main menu there is an option of reading/displaying 10 different views each loaded from 10 different buttons. Each view will contain text and some graphics (nothing heavy).

What's the best way of doing this?

Should I have one view controller for all or one view controller for each view?
0
Comment
Question by:nickedwards
1 Comment
 
LVL 5

Accepted Solution

by:
xdomains earned 2000 total points
ID: 33583742
You can decide to select between a single view controller or multiple view controllers based on these -

a) Data that the model is going to handle: If the data can be seggregated to be independent for each views, then you can go for multiple models, views and controllers. If you have any interdependencies between the data, then it best not to split them across models

b) Even if you have a single data model, it is perfectly fine to have multiple view-controllers. This is much cleaner, and you will have excellent control on what you want to do with the view. This will be highly maintainable and light weight while executing, because only the necessary views need to be loaded. You should keep a controller for each view, again for the maintainability aspects. This will also enable you to abstract and encapsulate the business logic behind the views.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question