O'Reilly logo

Cocoa Programming for OS X: The Big Nerd Ranch Guide by Aaron Hillegass, Adam Preble, Nate Chandler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting the Add Employee Button

Now that you have set up bindings from the table view to the array controller, the next step is to hook up the Add Employee button.

Unlike what you have done in previous exercises, in this exercise you will not set the buttons’ target to be File's Owner (recall that in this case, File's Owner is the document). Instead, NSArrayController is again going to come to your aid to serve as a controller object and augment your Document class: The array controller will be the target of the buttons, and their actions will be methods on NSArrayController (Figure 9.9).

Figure 9.9  The wiring between the buttons and the array controller

Control-drag from the Add Employee button to the Array Controller ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required