Re: Core data, bindings and multiple view NIBs
Re: Core data, bindings and multiple view NIBs
- Subject: Re: Core data, bindings and multiple view NIBs
- From: Keary Suska <email@hidden>
- Date: Tue, 26 May 2009 09:03:23 -0600
On May 26, 2009, at 5:21 AM, Tomaž Kragelj wrote:
I'm (again) banging my head with a single window, multiple views app
using core data. Each of my view is implemented within it's own NIB
and handled by a NSViewController subclass. The views share the same
data from the same MOC. Using the following core data model I cannot
bind the data as I want:
Group <--->> Item
My intention is to show the list of items that belong to selected
group. To do that, I add two NSArrayControllers to MainMenu.nib and
setup their bindings, then expose the controllers through IBOutlet
to my app delegate. This works as expected. Then I use a separate
NIB with the view which handles the list of all groups. It also
contains it's own NSArrayController instance (dragged from the
palette) which is bound to the "master" controller from the app
delegate. This works, it even supports binding the selection.
However I'm not able to do the same for the items view (again in
it's own NIB, handled by it's own NSViewController subclass) - the
closest solution I came to was that ALL items for ALL groups were
shown, however adding new ones (saving actually) failed since their
group relation was not set...
I'm sure I'm missing something, can someone point me to a proper
direction?
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.
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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