05.01.2013 Views

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

464<br />

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

Figure 25-13. The range of interface items available in Interface Builder’s Library panel<br />

Controllers: Although nibs are typically associated with the view portion of the modelview-controller<br />

pattern, nibs can also contain controller objects. These controllers can be<br />

completely self-contained, or can be set to a custom class. A common use for controller<br />

objects in the nib is to stand in for collections in the main controller, since the traditional<br />

collection classes, such as NSArray, are not compatible with bindings. There is also a special<br />

user defaults controller to enable binding directly to the preference system.<br />

Buttons: Interface Builder includes a wide variety of button styles. Technically, these are<br />

all the same NSButton object in different configurations. Using preconfigured buttons is a<br />

convenience, and it also provides consistency with other buttons in the application and<br />

system-wide.<br />

Cells: When Application Kit was being developed, computers were much slower than they<br />

are today. As such, a lightweight alternative to views was necessary. Cells are lightweight<br />

objects contained and used by views and controls throughout Cocoa. Cells resemble<br />

common controls, including text fields, combo boxes, level indicators, and image views.<br />

Formatters: Often the raw data behind a text field and what the user expects to see are<br />

two different things. The most common examples of this are dates, times, and currency.<br />

Formatters can be attached to text areas to alter the way their values are displayed.<br />

Inputs & Values: The most general group in the library, all these objects have in common<br />

is that they display or alter some value. This includes several varieties of text field, as well<br />

as check boxes, combo boxes, sliders, progress indicators, and the color and image wells.<br />

This group also contains the text view. In its default configuration, a text view resembles<br />

a multiline text field embedded in a scroll view. With a few clicks in the Inspector, a text<br />

view can be turned into a self-contained word processor, complete with formatting<br />

controls.<br />

Data Views: These objects display and allow interaction with data that is too complicated<br />

to be dealt with by the objects in the Inputs & Values group. These include tables, outlines,<br />

and multicolumn browsers, as used by the Finder. This group also contains some views<br />

new in <strong>Leopard</strong>: the collection view, which displays a grid of other views, and the<br />

predicate editor, a visual list of rules like the one used in Mail.

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

Saved successfully!

Ooh no, something went wrong!