• 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
Re: Coredata schema question.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coredata schema question.


  • Subject: Re: Coredata schema question.
  • From: Scott Ellsworth <email@hidden>
  • Date: Wed, 1 Jun 2005 11:23:21 -0700


On May 31, 2005, at 11:42 PM, Chris Hanson wrote:

On May 31, 2005, at 9:09 PM, James Andrews wrote:

I want to be able to link Photographs to Albums, and want to be able to put the same image in multiple Albums. I had thought maybe another Entity between Albums and Photographs, but I am not sure if that would work the way I would expect it too. Suggestions on how to do it, and explanations on why you would do it that way would greatly appreciated.


That's how you would do it in a database — you would use a many-to- many correlation table. However, with Core Data you're working with entities and relationships so you can simply declare that your Photograph.albums relationship and Album.photographs relationship are both to-many and are each others' inverses. Core Data will take care of the rest.

Beware - Core Data can suffer some major speed problems with many- many relationships, especially on SQL stores. DTS convinced me to remove my many-to-many relationships for performance reasons.


(If this bugs you, file a bug - I did.)

That said, it is not likely to be a problem for small data sets. I have ~5k entities, of which half were in one group, a quarter were in two, and a small number were in three or more. With 100 entities, performance was snappy.

Scott _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: Coredata schema question.
  • Next by Date: Re: Searching text
  • Previous by thread: Re: Coredata schema question.
  • Next by thread: two NSArrayControllers
  • Index(es):
    • Date
    • Thread