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 ...

Get Cocoa Programming for OS X: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.