Solved

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

Posted on 2010-09-01
1
528 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 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Preface   In the first 100 days of the Macintosh release in January 1984, Apple sold 72,000 of the computers. Relatively cheap, easy-to-use personal computer with a graphical operating system. I've never seen this model. I did see this one:   …
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.

911 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now