Core data: Inverse relationships with subclasses
Core data: Inverse relationships with subclasses
- Subject: Core data: Inverse relationships with subclasses
- From: Gideon King <email@hidden>
- Date: Wed, 29 Sep 2010 23:28:31 +1000
Hi, I have a bidirectional one to one relationship between two entities like this:
Foo <-> Bar, and Foo has a subclass FooSub. All entities are concrete.
Sometimes when I set the inverse relationship it's like this aBar.toFoo = aFoo, and this works fine, but when it's linking back to the subclass, aBar.toFoo = aFooSub, it fails with a validation error: toFoo is not valid, dangling reference to an invalid object = null.
I would have thought it would be OK for the relationship to point to an instance of FooSub shouldn't it? After all, it is a subclass of Foo. Or do things work differently for subclasses in Core Data? If so, how should I work around this problem?
TIA
Gideon
_______________________________________________
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