05.01.2013 Views

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Layout Views: This category includes views that provide layout but don’t display data,<br />

such as split views, scroll views, tab views, and boxes. There is also a custom view object<br />

for adding your own NSView subclasses to the nib.<br />

Special: In addition to the standard interface elements, there are many special views,<br />

controllers, and other objects provided by various APIs. Special groups included by default<br />

include Core Data, Web Kit, Address Book, Image Kit, PDF Kit, QuickTime Kit, and<br />

Quartz Composer. There is also a special Interface Builder template to integrate custom<br />

objects into the library.<br />

The Nib<br />

The main window represents the nib itself. While Interface Builder simply calls it Document, I’m<br />

going to refer to it as the Nib window. It offers three views: icon, list, and column, as shown in<br />

Figure 25-14. With the exception of Cover Flow, these are the same views used by the Finder.<br />

Figure 25-14. Interface Builder’s three nib views<br />

CHAPTER 25 MAC <strong>OS</strong> X DEVELOPMENT: THE TOOLS 465<br />

Although you can navigate your view hierarchy by clicking around the interface itself, some<br />

items can be difficult to select. The Nib window’s column view is especially convenient for selecting<br />

objects buried deep within subviews, especially as your interface becomes more complicated.<br />

Views are typically contained in other views, but every hierarchy is going to contain an<br />

object that is not contained by anything else. The Nib window contains these top-level objects,<br />

which are typically windows or panels. The Nib window also contains special components for<br />

your convenience:<br />

File’s Owner: Although a separate entity in its own right, the nib is not simply floating in<br />

space. It’s actually owned by your document class, MyDocument. In order to communicate<br />

with the document class, objects in the nib talk to the File’s Owner object.<br />

Application: Even though your nib has a direct line to its owner, sometimes its objects<br />

need to communicate with the application itself. The Application object facilitates that<br />

communication.<br />

First Responder: Sometimes an object needs to communicate with whoever is responsible<br />

for performing a given action. For times like these, <strong>Mac</strong> <strong>OS</strong> X maintains a party line<br />

known as the responder chain. To put an event on the responder chain, objects in the nib<br />

can send them to First Responder.<br />

Controllers: Controller objects are not views, so they can’t be contained as subviews. As<br />

such, the Nib window contains any controllers in the nib. Indeed, while windows and<br />

panels can simply be dragged anywhere on the screen, controller objects must be dragged<br />

into the Nib window directly. The one exception is the user defaults controller, which will<br />

automatically be added to the Nib window should you bind an object to it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!