3
votes

I want to use bindings in a table view, but I'm not using an NSArrayController. I've tried binding an array to my NSTableColumn (I'm handling sorting/searching myself), but it doesn't work. Is there some sort of magic under the hood that NSTableView/NSTableColumn exert when bound to an NSArrayController? More importantly, is NSArrayController useful for anything other than a NSTableView?

1

1 Answers

1
votes

The magic is definitely in the NSArrayController. NSArray doesn't have methods like selectedObject and such that bindings to NSTableColumn require. NSArrayController as the name suggests is the controller part of MVC where the model is an NSArray.

Secondly, NSArrayController is useful for any view that has an NSArray model backing it. Admittedly, this is usually NSTableView but it could be any view that uses the same data.