Manual binding with NSTableColumn (without NSArrayController)

I want to use bindings in a table view, but I do not use NSArrayController. I tried to bind the array to my NSTableColumn (I handle sorting / searching myself), but this does not work. Is there some kind of magic under the hood that NSTableView / NSTableColumn does when binding to NSArrayController? More importantly, is NSArrayController useful for anything but NSTableView?

+3
source share
1 answer

The magic is definitely in the NSArrayController. NSArray does not have methods like selectedObject, and requires binding to an NSTableColumn. NSArrayController, as the name implies, is part of the MVC controller, where the model is an NSArray.

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

+1
source

Source: https://habr.com/ru/post/1782545/


All Articles