Core Data Problem: Creating a child object creates unwanted parent
Core Data Problem: Creating a child object creates unwanted parent
- Subject: Core Data Problem: Creating a child object creates unwanted parent
- From: Kent Hauser <email@hidden>
- Date: Wed, 13 May 2009 08:54:38 -1000
Hi,
I can't figure out how to programmatically create a child object.
Using the example from the guides, when I create a new employee with
Employee *newEmployee = [NSEntityDescription
insertNewObjectForEntityForName:*@"employee"* inManagedObjectContext:*
context];*
I not only get a new employee, but also a new unnamed department. When I add
the employee to the correct department, the new unnamed department remains
as a bonus. I've done this in steps (not using the convenience class
method), and see that the unwanted department is created in the
-initWithENtity:insertIntoManagedObjectContext method.
What am I doing wrong?
Thanks. Kent
_______________________________________________
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