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

Binding the Table View’s Selection to the Array Controller

The selection indexes of an array controller are the indexes in arrangedObjects of the items which are currently selected. Note that the selection indexes are not indexes in the array controller’s content array: if you use a selection index to get an object out of the content array, you will not get the selected object. The selection in an array controller determines which items will be affected when the array controller performs certain actions. For example, as you just saw, when you trigger the remove(_:) action on an array controller, the items corresponding to these indexes in arrangedObjects will be removed.

Bind the table view’s Selection Indexes 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