• 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
Core Data Problem: Creating a child object creates unwanted parent
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Core Data Problem: Creating a child object creates unwanted parent
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: beginner's question: having problems with saving/loading
  • Next by Date: Re: Getting "Unknown class 'someClassName' in nib file" message
  • Previous by thread: Re: struggling with binding, NSOutlineView, and NSTableView
  • Next by thread: Re: Core Data Problem: Creating a child object creates unwanted parent
  • Index(es):
    • Date
    • Thread