Making Connections

When the Quiz application loads its interface from MainWindow.xib, the objects that make up the interface are floating around in memory. The QuizAppDelegate (a controller object) needs to know where the labels (view objects) are in memory so that it can tell them what to display. The buttons (view objects that the user interacts with) need to know where the QuizAppDelegate is so that they can report when they are tapped. Your objects need connections. A connection lets an object know where another object is in memory.

Figure 1.14 shows the connections for Quiz. Some have already been made by the template (between the window outlet of QuizAppDelegate and the UIWindow instance, for example), and some were made implicitly (dragging ...

Get iOS Programming: The Big Nerd Ranch Guide, Second Edition 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.