Let’s say I have the following situation:
When I select different rows in the NSTableView, it magically updates the NSArrayController (PersonController) selection. How is the NSTableView doing this? Does it do something like this:
- (void)bind:(NSString *)binding toObject:(id)observableController withKeyPath:(NSString *)keyPath options:(NSDictionary *)options;
{
if([observableController isKindOfClass:[NSArrayController class]]){
// got the NSArrayController, which can be used to change selection
} else {
// not an NSArrayController, don't try to change selection
}
//...
}
I ask because I’m implementing my own bindable NSControl, and I’d like it to modify the selection of the bound NSArrayController like an NSTableView would.

On a hunch, I overrode
bind:toObject:withKeyPath:options:on theNSTableViewand both theNSTableColumnobjects and made them log their bindings. This is the output:Even though the only bindings I made were to “value” of the NSTableColumn objects, it looks like IB is adding additional bindings automatically.
NSTableViewis able to modify theNSArrayControllerselection because it’s bindingselectionIndexesautomatically in IB.This is confirmed in the NSTableView Bindings Reference, for both
selectionIndexesandsortDescriptors.