• 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: Added object to MOC, why isn't this a bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Added object to MOC, why isn't this a bug?


  • Subject: Re: Added object to MOC, why isn't this a bug?
  • From: Chris Hanson <email@hidden>
  • Date: Thu, 1 Jun 2006 14:41:46 -0700

On Jun 1, 2006, at 2:33 PM, Bobby B wrote:

Thank you for this.  I didn't realize that the mutable set it returned
was tracked, I thought I would have to reset the values.

No, no need to reset.

So in the below, when I add the newAlbum, which is a duplicate, what
is CoreData doing behind the scenes that prevents it from adding a
duplicate?

Generally a question of the form "what is ___ doing behind the scenes" can't be answered in the detail the person asking may like.


In this case, the simple way to think about it is that the to-many relationship is represented by a set (in the mathematical or relational sense) and sets never contain duplicates. So if you add the same object to a set multiple times, you still only have one element in the set for it.

  -- Chris

_______________________________________________
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


  • Follow-Ups:
    • Re: Added object to MOC, why isn't this a bug?
      • From: "Bobby B" <email@hidden>
References: 
 >Added object to MOC, why isn't this a bug? (From: "Bobby B" <email@hidden>)
 >Re: Added object to MOC, why isn't this a bug? (From: Chris Hanson <email@hidden>)
 >Re: Added object to MOC, why isn't this a bug? (From: "Bobby B" <email@hidden>)

  • Prev by Date: Re: Added object to MOC, why isn't this a bug?
  • Next by Date: Re: Newbie error
  • Previous by thread: Re: Added object to MOC, why isn't this a bug?
  • Next by thread: Re: Added object to MOC, why isn't this a bug?
  • Index(es):
    • Date
    • Thread