Re: Core data, bindings and multiple view NIB
Re: Core data, bindings and multiple view NIB
- Subject: Re: Core data, bindings and multiple view NIB
- From: Tomaž Kragelj <email@hidden>
- Date: Wed, 27 May 2009 08:30:19 +0200
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 (email@hidden)
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:
This email sent to email@hidden