How are you binding the "item" array controller? It has to be bound to the group list array controller or to a property of the app delegate that depends on its selection.

In MainMenu.nib the two array controllers are bound:

GroupsController:
- managed object context -> AppController.managedObjectContext

GroupItemsController:
- managed object context -> AppController.managedObjectContext
- content set -> GroupController.selection.items

The MainMenu.nib also implements the main window which contains placeholders for the two views described later and test lists which are bound to the above controllers directly, so I can test if the views actually work. In the AppController's (which it the application's delegate) awakeFromNib, the two NSViewController subclasses are instantiated from the respective nibs, one for handling groups and the other for handling selected group items.

In GroupsView.nib (list that handles groups)
GroupsController:
- managed object context -> Application.delegate.managedObjectContext
(this works, I can add and remove items and they are properly updated in the test list on the main window)

In ItemsView.nib (list that handles selected group items)
GroupItemsController:
- managed object context -> Application.delegate.managedObjectContext
- ???
The question marks are what I'm missing - if I don't bind to anything, then the array controller will simply show all items for all groups, however I want to bind this to the GroupItemsController from the MainMenu.nib (it is accessible through the Application.delegate, but I don't know how to bind it in order to show only the items selected by the group in GroupsView.nib...

Hope this makes it clearer,
Tom
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to