Re: Why is it wrong to have relationships without an inverse in Core Data?
Re: Why is it wrong to have relationships without an inverse in Core Data?
- Subject: Re: Why is it wrong to have relationships without an inverse in Core Data?
- From: Rick Mann <email@hidden>
- Date: Fri, 21 Jun 2013 14:10:40 -0700
On Jun 21, 2013, at 14:03 , Kyle Sluder <email@hidden> wrote:
> On Fri, Jun 21, 2013, at 01:55 PM, Rick Mann wrote:
>> But Core Data complains that activeChild is misconfigured because it
>> doesn't have an inverse. But I have no need for an inverse, why does Core
>> Data?
>
> Apple's explanation, straight from the docs:
> http://developer.apple.com/library/mac/documentation/cocoa/conceptual/coredata/Articles/cdRelationships.html#//apple_ref/doc/uid/TP40001857-SW6
>
> --Kyle Sluder
Oh hey, I just realized, I can re-use an existing inverse relationship. Given the example I stated earlier,
Parent
children to-many to Child (inverse is parent)
activeChild to-one to Child
Child
parent to-one to Parent
I can re-use the parent relationship:
Parent
children to-many to Child (inverse is parent)
activeChild to-one to Child (inverse is parent)
Child
parent to-one to Parent
At least, Xcode no longer warns about it being a one-way relationship. This makes me happy, and hopefully makes Core Data happy.
--
Rick
_______________________________________________
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