• 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
Abstract entities and relationships
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Abstract entities and relationships


  • Subject: Abstract entities and relationships
  • From: Charilaos Skiadas <email@hidden>
  • Date: Wed, 13 Jul 2005 03:15:56 -0500

I have three entities:
1) GradeItem is an abstract entity. It has a to-one relationship "type" to entity GradeType.
2) ConcreteGradeitem is an entity with parent GradeItem.
3) GradeType is an entity with a to-many relationship "gradeItems" to GradeItem, inverse to "type".


Now, I create an object of type 2 in code, and set its type through setValue:forKey: The code is basically:

NSManagedObjectContext *theContext = [self managedObjectContext];
NSManagedObject *item = [NSEntityDescription insertNewObjectForEntityForName:@"ConcreteGradeItem" inManagedObjectContext:theContext];
[item setValue:type forKey:@"type"];


Now, I would expect that gradeItems would be updated from this, since it is inverse to type. However it doesn't, as looking at the XML file shows. If one the other hand I use
NSManagedObject *item = [NSEntityDescription insertNewObjectForEntityForName:@"GradeItem" inManagedObjectContext:theContext];


instead, then it does get updated.
Now, I would expect that it should not matter to GradeType, which of the two I use, but it does. Is this a misconception on my part, or a bug?


thanks,
Haris


_______________________________________________ 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:
    • Relationship on parent not observed properly for subentity (was: Abstract entities and relationships)
      • From: Charilaos Skiadas <email@hidden>
  • Prev by Date: Re: nil properties in Fetch Requests
  • Next by Date: LSUIElement and LSBackgroundOnly
  • Previous by thread: Re: How to embed a file into my project
  • Next by thread: Relationship on parent not observed properly for subentity (was: Abstract entities and relationships)
  • Index(es):
    • Date
    • Thread