Core Data add object
Core Data add object
- Subject: Core Data add object
- From: Ivan C Myrvold <email@hidden>
- Date: Sun, 25 May 2008 13:08:45 +0200
I have a core data project with two entities, Call and CallEvent.
In the Call entity, I have a to-many relationship to CallEvent.
I create the two objects in code with
thecall = [NSEntityDescription insertNewObjectForEntityForName:@"Call"
inManagedObjectContext:[self managedObjectContext]];
and
thecallevent = [NSEntityDescription
insertNewObjectForEntityForName:@"CallEvent" inManagedObjectContext:
[self managedObjectContext]];
I now want to add the callevent object to thecall object. I see in the
NSManagedObject subclass Call there is a method prepared for this,
- (void)addCallEventsObject:(CallEvent *)value;
simply doing
[thecall addCallEventsObject:thecallevent];
is not working, of course. So how do I add this object?
Ivan
_______________________________________________
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