Re: Added object to MOC, why isn't this a bug?
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