• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core Data: Master-Detail question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data: Master-Detail question


  • Subject: Re: Core Data: Master-Detail question
  • From: Matt Ronge <email@hidden>
  • Date: Thu, 22 Dec 2005 16:20:57 -0600

Frederick C. Lee wrote:

Greetings:
I'm trying to construct a master-detail binding using NSArrayControllers. I'll use the 'Core Recipe' paradigm here.
I want to be able to display a NSPopupButton (Recipe) that is the master entity controlling the table of ingredients.
The elements of the NSTableView are dependent on the NSPopupButton.

Scenario:

Entities (NSManagedObjects):
Recipe : Ingredients (1:many).

Question: How do I link the Recipe with its associated Ingredients per Entity-Relationship diagram so that only the ingredients are displayed per recipe?

In short, how do I make the Ingredient Controller dependent on the Recipe Controller?

What you want to do is attach your ingredients controller to your recipe controller using bindings. So in the ingredients controller setup a contentSet binding that is attached to recipe with selection, do NOT use arrangedObjects. When the selection is changed in the popup the selection will be changed in the recipe controller and it's corresponding ingredients will change. If you just have the managedObjectContext binding setup and no contentSet with selection binding setup, it will pull all of the ingredients from that database which is what I assume is happening now.

Hope that helps
--
Matt Ronge
http://www.theronge.com
_______________________________________________
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
References: 
 >Core Data: Master-Detail question (From: "Frederick C. Lee" <email@hidden>)

  • Prev by Date: Core Data: Master-Detail question
  • Next by Date: The simplest recorder
  • Previous by thread: Core Data: Master-Detail question
  • Next by thread: The simplest recorder
  • Index(es):
    • Date
    • Thread