I am having trouble displaying the contents of one NSArrayController in two windows defined in different XIBs.
In my main window (in MainMenu.xib) I have an NSTableView associated with NSArrayController
In my second XIB, I have another window containing an NSTableView. I created a new NSArrayController and linked the table to the contents of this NSArrayController.
Both NSArrayControllers are bound to the same NSArray.
At first, everything is fine, but the problem is that if the object is added to the array using NSArrayController in the main window, the secondary data view window is not updated. This is most likely because he does not know that he needs to update himself, since his NSArrayController was not used to add a new object.
What I would like to do is use the same instance of NSArrayController in both windows. Thus, if an object is added to the array, both views will be notified of this change.
The problem is that I cannot figure out how to do this in Interface Builder. I cannot bind NSArrayController to another NSArrayController (I get a runtime error indicating that it can only be bound to NSArray). Connecting NSArrayController to the NSArrayController member of the file owner will not help either, as it will simply destroy the NSArrayController that I want to use.
I think I could set the bindings in the code, but it seems to be better to use Interface Builder if possible. Is there a way to do this in the Builder interface, or maybe the best way to install this together?
: :
- NSTableView NSArrayController ( NSArrayController, : "[NSArrayController count]: , " )
- arrayController.arrangedObjects.propertyName
, . , , NSArrayController, NSArrayController. , NSArrayController, .
NSArrayController "Bind to" ComboBox, builtObjects . , - .
- ?