I have a list of objects displayed in an NSTableView (bound to an NSArrayController). When you select an object in that list I want to show a detail view in a second NSTableView. My object has an array property. I can’t figure out how to wire the bindings for this. binding to NSArrayController’s selection doesn’t work, as that’s a single object, and NSTableView expects to be bound to an array…
I have a list of objects displayed in an NSTableView (bound to an NSArrayController).
Share
Create a second
NSArrayControllerand bind its contents to the first controller using a keypath ofselection.<name of your object's array property>.So, if your first table view is displaying objects of class
Personand yourPersonclass has achildrenproperty, you would bind the second array controller toselection.children.You need a separate array controller for each array that you want to manage in a table view.