I'm having trouble figuring out the right way to bind an NSArrayController (in turn bound to by a table view) to an NSArray property of an NSDocument instance via a view controller.
My NSDocument subclass has a property NSArray * pages
. I first mirrored the pages
property in the view controller, but that means that the table view does not update when the NSDocument adds items to its pages
array. The only ways to force an update in this case are either will..
/didChangeValueForKey:@"pages"
in the view controller, but that's not practical when the change is not triggered from the view controller. Calling will/didChangeValueForKey
in the NSDocument directly does not trigger the array controller to update.
I tried to bind directly to the ViewController's document.pages
, but that doesn't seem to work, or at least doesn't show any updates, either.
What would be the right technique to use here?