7. View Controllers

View Controllers and XIB Files

In the Quiz application, you had one “screen,” one controller, and one XIB file:

Figure 7.1. Quiz, a single screen application

image

But what about applications with multiple “screens”? Typically, each screen gets its own controller and XIB file. Figure 7.2 shows an example application with two screens and the resulting controllers and XIB files.

Figure 7.2. Example of an application with two screens

image

Each controller has a view that gets placed on the window. (The view often has subviews like buttons ...

Get iPhone Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.