• 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: newbie problems with master-detail relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie problems with master-detail relationship


  • Subject: Re: newbie problems with master-detail relationship
  • From: Scott Stevenson <email@hidden>
  • Date: Sun, 29 Oct 2006 19:21:41 -0800


On Oct 29, 2006, at 1:58 PM, shaun bear wrote:

Am I adding instantiating the  detail object correctly?
Is somthing I should be doing in bindings that I am missing?
Can you see anything wrong with method: add?

It looks like you might not be clear how Core Data relationships work, but it's hard to tell since you didn't describe your model.


It would be unusual (but not impossible) for a "parent" or a "child" to be a raw NSString object. It would usually be another managed object of some sort. There's no way for the NSString to "own" another object like that.

At minimum, this line:

	[master  addDetailObject: @"detail"];

Should be changed to this...

	[master  addDetailObject: detail];

... so that a link is actually created between the "master" and "detail" objects. The version you have tries to create a relationship between the "master" object, and an NSString object with the value @"detail".

Hope that's clear. This can be pretty confusing stuff when you're just getting started.

   - Scott
_______________________________________________
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: 
 >newbie problems with master-detail relationship (From: shaun bear <email@hidden>)

  • Prev by Date: Re: Menu synchronization
  • Next by Date: Using NSUserDefaultsController with an NSPopUp button
  • Previous by thread: newbie problems with master-detail relationship
  • Next by thread: Menu synchronization
  • Index(es):
    • Date
    • Thread