• 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: Inverse relationships with subclasses
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Core data: Inverse relationships with subclasses
      • From: Quincey Morris <email@hidden>
    • Re: Core data: Inverse relationships with subclasses
      • From: jeremy <email@hidden>
  • Prev by Date: Re: Button performs action and then stores result to a binding?
  • Next by Date: Re: My NSSwappedDouble decoding crashes on iPhone 4
  • Previous by thread: Re: Button performs action and then stores result to a binding?
  • Next by thread: Re: Core data: Inverse relationships with subclasses
  • Index(es):
    • Date
    • Thread