• 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
Multiple relationships between two entities
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multiple relationships between two entities


  • Subject: Multiple relationships between two entities
  • From: Rob Keniger <email@hidden>
  • Date: Tue, 13 Oct 2009 16:04:03 +1000

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

  • Follow-Ups:
    • Re: Multiple relationships between two entities
      • From: Matthew Lindfield Seager <email@hidden>
    • Re: Multiple relationships between two entities
      • From: Kiran Kumar S <email@hidden>
  • Prev by Date: Re: More Core Data Questions
  • Next by Date: Re: TIFFRepresentation, different TIFF format under Snow Leopard
  • Previous by thread: Re: How to iterate over all objects stored with NSCoder
  • Next by thread: Re: Multiple relationships between two entities
  • Index(es):
    • Date
    • Thread