Re: Multiple relationships between two entities
Re: Multiple relationships between two entities
- Subject: Re: Multiple relationships between two entities
- From: Matthew Lindfield Seager <email@hidden>
- Date: Tue, 13 Oct 2009 17:29:48 +1100
Inverse of what?
So Item A has link 1 as it's normal link and link 2 as it's alternate
link but then what if link 2 is also the normal link for item B.
My guess is you'll need 2 inverse relationships!
Matt
On Tuesday, October 13, 2009, Rob Keniger <email@hidden> wrote:
> I'm just getting started with Core Data so go easy on me.
>
> I am moving my existing app across to Core Data and I'm having trouble with a few concepts.
>
> At present (pre-Core Data) my app has a model object ("Item") which is used as the node object in an NSTreeController.
>
> This model object has multiple ivars of another custom object ("Link") like so:
>
> @interface Item : NSObject
> {
> Link* normalLink;
> Link* alternateLink;
> }
> @end
>
> I'm trying to replicate this in my Core Data model. I have set up two entities, Item and Link. I have created two relationships in the Item entity, "normalLink" and "alternateLink", both pointing to the Link entity.
>
> Basically, I want each of these relationships to point to an instance of the Link entity.
>
> However, now I have a problem. My Link entity has one relationship ("item") which should be the inverse relationship, but that's not possible because I can only have one inverse relationship.
>
> I think I'm getting mixed up here, how should this actually be modelled?
>
> --
> Rob Keniger
>
>
>
> _______________________________________________
>
> 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
>
--
Safe, comfortable and satisfied? Consider supporting some people who aren't!
I'm riding 100 kilometres to raise funds for refugees!
http://my.e2rm.com/personalPage.aspx?registrationID=750445
_______________________________________________
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