The programmers who developed Cocoa Touch used a concept known as the Model-View-Controller (MVC) as the foundation for iPhone and iPad app code. Here is the basic idea.
Model: This holds the data and classes that make your application run. It is the part of the program where you might find sections of code I told you to ignore. This code can also hold objects that represent items you may have in your app (e.g., pinballs, cartoon figures, names in databases, appointments in your calendar).
View: This is the combination of all the goodies users see when they use your app. This is where your users interact with buttons, sliders, controls, and other experiences they can sense and appreciate. Here you may have a main view that is made up of a number of other views.
Controller: The controller links the model and the view together while always keeping track of what the user is doing. Think of this as the structural plan - the backbone - of the app. This is how we coordinate what buttons the user presses and, if necessary, how to change one view for another, all in response to the user's input, reactions, data, etc.
Consider the following example that illustrates how you can use the MVC concept to divide the functionality of your iPhone/iPad app into three distinct categories. The figure above shows a representation of your app; I've called it 'MVC Explained.' You can see that the VIEW displays a representation - a label - of 'Your very cool fantastic App Includes 3 layers: A, B and C.'
In the CONTROLLER section of the app, we see the three individual layers separated out, Layer 'A,' Layer 'B,' and Layer 'C.' Depending on which control mechanism the user clicks in the VIEW domain, the display the user sees, the CONTROLLER returns the appropriate response -the next view from the three prepared layers.
Your app will probably utilize data of some type, and this information will be stored in the MODEL section of your program. The data could be phone numbers, players' scores, GPS locations on a map, and so on.