Re: Core Data relationship question
Re: Core Data relationship question
- Subject: Re: Core Data relationship question
- From: Felix Franz <email@hidden>
- Date: Mon, 13 Aug 2007 11:21:24 +0200
On Aug 13, 2007, at 10:54 AM, Alex Reynolds wrote:
Many thanks!
It looks like I can also set the relationship the following way:
NSManagedObject *display = [NSEntityDescription
insertNewObjectForEntityForName: @"Display"
inManagedObjectContext:managedObjectContext];
[display setValue:targetObject forKey:@"server"];
[display didChangeValueForKey: @"server"];
(The "server" key is a relationship item.)
Compared with your approach, is my approach the wrong way to set up
the relationship?
this is correct as well (if the back-relationship is set ...).
You do not need to call the didChangeValueForKey: method. CoreData
does this for you internally ...
Cheers,
felix
_______________________________________________
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