Re: Core Data: Binding one NSTableView to another
Re: Core Data: Binding one NSTableView to another
- Subject: Re: Core Data: Binding one NSTableView to another
- From: Chris Hanson <email@hidden>
- Date: Mon, 27 Jun 2005 11:26:50 -0700
On Jun 27, 2005, at 10:22 AM, J. Scott Anderson wrote:
I have a problem that is similar but not quite enough to the Master-
Detail example. I want to connect NSTableView to another via
Bindings such that a selection in the first NSTableview shows
related content in the other.
Do you mean that you want your first table to show one set of objects
(say Recipes) and your second table to show a relationship from the
first (say the Ingredients for a recipe)? If so, that's the
classical master-detail pattern.
To do this, you'd have two array controllers, one for instances of
the Recipe entity and one for instances of the Ingredient entity.
Both need to be bound to the same managed object context.
The first table view's columns are bound to the Recipe array
controller. The second table view's columns are bound to the
Ingredient array controller. Set both controllers to automatically
prepare content. And finally, bind your Ingredient array
controller's "contentSet" binding to the Recipe array controller
using the content key path "arrangedObjects" and the to-many
relationship you want to view, for example "ingredients".
-- Chris
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden