• 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: Core Data "Uniqueing" not happening as expected
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Core Data "Uniqueing" not happening as expected
      • From: Quincey Morris <email@hidden>
References: 
 >Core Data "Uniqueing" not happening as expected (From: Jerry Krinock <email@hidden>)
 >Re: Core Data "Uniqueing" not happening as expected (From: Quincey Morris <email@hidden>)
 >Re: Core Data "Uniqueing" not happening as expected (From: Jerry Krinock <email@hidden>)
 >Re: Core Data "Uniqueing" not happening as expected (From: mmalc Crawford <email@hidden>)

  • Prev by Date: Re: Core Data capabilities questions
  • Next by Date: Re: Core Data "Uniqueing" not happening as expected
  • Previous by thread: Re: Core Data "Uniqueing" not happening as expected
  • Next by thread: Re: Core Data "Uniqueing" not happening as expected
  • Index(es):
    • Date
    • Thread