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

Re: Core Data: inverse relationship not updated until next Run Loop


  • Subject: Re: Core Data: inverse relationship not updated until next Run Loop
  • From: Eric Lin <email@hidden>
  • Date: Fri, 12 Mar 2010 17:54:52 -0800

I see. Thanks for both of your responses.

Eric

On Thu, Mar 11, 2010 at 10:26 PM, Frank Illenberger <email@hidden>wrote:

> >> 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?
> >
> > Deletes are propagated at the end of he current event, or at save time,
> depending how the MOC is configured.
>
> But you can call [moc processPendingChanges] directly after the delete to
> propagate the changes immediately.
>
> Frank
> _______________________________________________
>
> 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
>
_______________________________________________

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

References: 
 >Core Data: inverse relationship not updated until next Run Loop (From: Eric Lin <email@hidden>)
 >Re: Core Data: inverse relationship not updated until next Run Loop (From: Jim Correia <email@hidden>)
 >Re: Core Data: inverse relationship not updated until next Run Loop (From: Frank Illenberger <email@hidden>)

  • Prev by Date: Re: [NSTableview] can't make selected text stay black
  • Next by Date: Re: performSelector doesn't work for modal window
  • Previous by thread: Re: Core Data: inverse relationship not updated until next Run Loop
  • Next by thread: Use of KVC Array operators
  • Index(es):
    • Date
    • Thread