Re: Core Data "Uniqueing" not happening as expected
Re: Core Data "Uniqueing" not happening as expected
- Subject: Re: Core Data "Uniqueing" not happening as expected
- From: Jerry Krinock <email@hidden>
- Date: Sun, 21 Jun 2009 19:02:47 -0700
Well, the explanation of where these two Bars came from turned out to
be quite interesting, so I thought I'd report it.
It turns out that I wasn't inserting any Bars at all into that moc.
But when I did this:
[foo1 setBar:bar] ;
[foo2 setBar:bar] ;
the Foos and the bar were in different managed object contexts that
had different stores -- Yikes -- I was setting cross-store
relationships. Apparently, the Core Data runtime responds to this
attempt cordially, by "doing what I mean". It copies attributes and
inserts a new one into the same managed object context as the other
object in the relation.
Whew, I thought I was almost ready to ship, working on the last few
minor bugs, this one being a duplicate item showing occasionally in a
popup menu. I think I would have preferred a resounding crash, well
maybe a nice warning, instead of the "do what I mean". But I suppose
that if Apple changed it now they might break alot of working apps out
there which contain this programming error.
_______________________________________________
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