• 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
Core Data: inverse relationship not updated until next Run Loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data: inverse relationship not updated until next Run Loop


  • Subject: Core Data: inverse relationship not updated until next Run Loop
  • From: Eric Lin <email@hidden>
  • Date: Thu, 11 Mar 2010 17:11:24 -0800

In using Core Data, I was under the impression that if I do this:

[department addEmployeesObject:employee]  // department now has 1 employee
[moc deleteObject:employee]

Then department will end up with no employees, assuming that the inverse
relationship is set correctly.

But it turns out within the same run loop, if I inspect
[department.employees count], then the value is 1. But in the next run loop,
the value becomes 0, which is what it should be.

Is my observation accurate or is something wrong?

Does this mean that although I generally don't need to call [department
removeEmployeesObject:employee] after deleting an employee, if I want
department to be in a consistent state within the same event loop, I will
need to make that call?

Thanks,
Eric
_______________________________________________

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: inverse relationship not updated until next Run Loop
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: Help visualizing something in IB
  • Next by Date: Re: Switching methods in private classes in Apple frameworks
  • Previous by thread: Answer: Bison with Objective-C Semantic Actions? Works
  • Next by thread: Re: Core Data: inverse relationship not updated until next Run Loop
  • Index(es):
    • Date
    • Thread