Hi,
For OSX, bindings between a view-based tableView and an ArrayController can easily be made in IB: https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/TableView/PopulatingViewTablesWithBindings/PopulatingView-TablesWithBindings.html#//apple_ref/doc/uid/10000026i-CH13-SW4.
1-Bind the tableView to the ArrayController
2-Bind the controls in the cell to the "Table Cell View"
But how are we supposed to do it programmatically?
The binding between the TableView and the arrayController is fine in code, by putting in viewDidLoad something like (in Swift):
tableView.bind(NSContentBinding, to: dataController, withKeyPath: "arrangedObjects", options: nil)
tableView.bind(NSSelectionIndexesBinding, to: dataController, withKeyPath:"selectionIndexes", options: nil)
tableView.bind(NSSortDescriptorsBinding, to: dataController, withKeyPath: "sortDescriptors", options: nil)
But how are made the second part of the binding? This second part is much more blurry if undocumented. The documentation lists the classes that support Cocoa bindings (https://developer.apple.com/library/mac/documentation/Cocoa/Reference/CocoaBindingsRef/CocoaBindingsRef.html) but Table Cell Views are not mentionned.
Moreover, if it exists, where is supposed to be written the code ?
tableCellView.imageView?.bind(NSValueBinding, to: tableCellView, withKeyPath: "objectValue.something", options: nil])
This code assumes then that the tableCellView should be an IBOutlet.
Does anyone have a clue about these things?
Or am I completely off the mark?
Many thanks for your help !