Xcode 4 Differences for Chapter 4

Changes in Chapter 4, "Object Messaging," are mainly related to Interface Builder now being an integrated editor within the Xcode environment, rather than a separate application.

The changes in these posts are divided by section headings, in the order these appear in the book.

4.1 Defining a New Method

The default keyboard shortcut for the Open Quickly… command has changed to Shift-Cmd-O.

Implementing Our New Method

There is no Go to Counterpart icon in Xcode 4, but there is a Navigate > Jump to Next Counterpart menu command (Ctrl-Cmd-UpArrow).

There is also a new Editor in Xcode 4, the Assistant Editor, which will automatically display a counterpart file to the right of the file being edited. Choose View > Editor > Assistant (Opt-Cmd-Return), or use the Editor segmented control in the main toolbar, to display both the NotifyingClass.h and NotifyingClass.m files side by side:

Xcode 4 Assistant Editor to Show Counterpart Files

Communication Between Xcode and Interface Builder

References to Interface Builder in this section obviously relate to the changes made in the integrated interface editor.

Connecting the Action in Interface Builder

If you used the Assistant Editor mentioned above, and are running out of space on your screen to display everything, you may wish to switch back to the Standard Editor (Cmd-Return).

You’ll find the Push Button object in the Object Library—View > Utilities > Object Library (Ctrl-Opt-Cmd-3)—is at the bottom of the right panel:

Xcode 4 Interface Library

The NotifyingClass instances are the two blue cubes at the bottom of the list of icons on the left of the Interface Editor graph paper area.

Xcode 4 Making an Action Connection

Connecting Outlets in Interface Builder

The text view’s “connectable area” is right at the very top of the enclosing scroll view area:

Xcode 4 Making an Outlet Connection

Sending a Message to an Object

The Developer Documentation is available via Help > Documentation and API Reference (Shift-Opt-Cmd-?), or by clicking the Organizer button in the main toolbar and choosing Documentation.

You may need to click the NSTextView Class Reference entry in the Reference section on the left before the contents appear in the main panel:

Xcode 4 Documentation Window