Re: Core Data To-Many Relationship KVO
> On Feb 11, 2015, at 5:36 PM, Roland King wrote: > > processPendingChanges:, it’s on NSManagedObjectContext That’s what I was looking for. Thanks for your help. Richard Charles ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Core Data To-Many Relationship KVO
> On 12 Feb 2015, at 08:27, Richard Charles wrote: > > >> On Feb 11, 2015, at 4:51 PM, Roland King wrote: >> >> committing the core data changes removes them from all the relationships and >> fires KVO changes. see propagatesDeletesAtEndOfEvent: and >> commitPendingChanges. In AppKit usually deletes are propagated once around >> the event loop, in other places they won’t propagate until there’s a save or >> commitPendingChanges: is called. > > > What “event” does propagatesDeletesAtEndOfEvent refer to? An event loop, some > type of Core Data event? The documentation as I read it is unclear. No idea - why don’t you put a breakpoint in your KVO handler and see where it’s being called from, my guess would be the end of the event loop. If you want it earlier try calling the method to process pending changes, or remove it from the relationship yourself as well as deleting it. > > Also commitPendingChanges: does not appear to be in any method of the Cocoa > frameworks. processPendingChanges:, it’s on NSManagedObjectContext > > Richard Charles > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Core Data To-Many Relationship KVO
> On Feb 11, 2015, at 4:51 PM, Roland King wrote: > > committing the core data changes removes them from all the relationships and > fires KVO changes. see propagatesDeletesAtEndOfEvent: and > commitPendingChanges. In AppKit usually deletes are propagated once around > the event loop, in other places they won’t propagate until there’s a save or > commitPendingChanges: is called. What “event” does propagatesDeletesAtEndOfEvent refer to? An event loop, some type of Core Data event? The documentation as I read it is unclear. Also commitPendingChanges: does not appear to be in any method of the Cocoa frameworks. Richard Charles ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Core Data To-Many Relationship KVO
> On 12 Feb 2015, at 07:27, Richard Charles wrote: > > I have a Core Data in-memory store. There is a managed object which uses KVO > on a to-many relationship property of itself. > > When an object at the other end of the relationship is deleted using > [managedObjectContext deleteObject:object] the KVO change notification is not > sent right away. > > What triggers or will trigger the KVO change notification? > > Richard Charles > committing the core data changes removes them from all the relationships and fires KVO changes. see propagatesDeletesAtEndOfEvent: and commitPendingChanges. In AppKit usually deletes are propagated once around the event loop, in other places they won’t propagate until there’s a save or commitPendingChanges: is called. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com