Hi everybody,
i'm trying to port portions of my code to use cocoa bindings: more specifically, NSArrayControllers. But i've made an afflicting discovery: an array controller is not aware of changes made to the array programmatically (i mean, adding or removing objects of the array in your code for example) ! Shouldn't it be a default behavior of NSArrayController ?! I guess i'll have to subclass the controller class or register for some events...
How would *you* do that ? ;-)
"Question: if I have an array in the model and I want it to be displayed in an NSTableView, but items can be added to the array from other places than the GUI, is an NSArrayController the right solution? cause if I add items to the array (from another source), they will not show in the NSTableView, unless I issue a will/didChangeValueForKey: with my actual array being the key. I.e. if my NSTableView is set to display "arrangedObjects.name" shouldn't that then trigger a notify, when new items are added to the array? You can call [ myView reloadData ]; to update the display No, because the model which change the array do not know who is currently showing that array in the GUI -- it should happen automatically thru bindings..."
|