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

Configuring RaiseMan’s Remove Button

Now that your array controller knows what the user has selected in the table view, you can use the array controller to ensure that the Remove button is only enabled when appropriate – when the array controller has an object selected. This will prevent your users from clicking Remove when they have not selected an employee to remove.

You will bind the button’s enabled property to the array controller’s canRemove property. This property is true only when the array controller can actually do removal. In other words, this property will be false when the array controller does not have any objects selected.

To set up this binding, select the Remove button and switch to the bindings inspector. In the ...

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