Re: newbie problems with master-detail relationship
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