• 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
CoreData Parent Entity Confusion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreData Parent Entity Confusion


  • Subject: CoreData Parent Entity Confusion
  • From: Andrew Kimpton <email@hidden>
  • Date: Thu, 18 Aug 2005 16:45:22 -0700

In my data model I have three (non-abstract) entities :

'Race'  and 'Heat' and 'Final'

Each has a similarly named Obj-C Class

'Heat' and 'Final' both have their Parent set to 'Race' in the Data Model. 'Heat' and 'Final' classes both inherit from the Obj-C 'Race' class, which in turn inherits from NSManagedObject

However when I instantiate an instance of the 'Heat' entity with :

Race *race = [NSEntityDescription insertNewObjectForEntityForName:@"Heat" inManagedObjectContext:[self managedObjectContext]];

the resultant class pointer in race is of type NSManagedObject. If however the entity name is @"Race" then the resultant pointer is indeed of type Race.

Any thoughts on what could be going wrong ? The data model graph looks perfectly correct, and there are no errors from the above line at run time, just the wrong type of object being created (though it does have the correct properties for a 'Heat' entity).

Andrew 8-)

_______________________________________________
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


  • Follow-Ups:
    • Re: CoreData Parent Entity Confusion
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: Unicode in AppleScript
  • Next by Date: stringByResolvingSymlinksInPath doesn't?
  • Previous by thread: Re: How to use NSDocument to load and display an XML file?
  • Next by thread: Re: CoreData Parent Entity Confusion
  • Index(es):
    • Date
    • Thread