Re: core data - delete of object.

2008-11-18 Thread Ashley Clark
That's true, processPendingChanges is used by the context to implement undo functionality but there's no reason why you can't call it yourself after your delete since you've disabled the context's undo functionality. Here's an example where events is an NSArrayController: - (IBAction)del

Re: core data - delete of object.

2008-11-18 Thread John Clayton
I guess processPendingChanges is only called if there is an undoManager? Correct? I don't have one - I disabled it intentionally. I've tried that notification, its only fired on save of the context. Thanks -- John Clayton Skype: johncclayton On 18/11/2008, at 1:22 PM, Ashley Clark wrote:

Re: core data - delete of object.

2008-11-18 Thread Ashley Clark
According to the documentation and to my quick test, the NSManagedObjectContextObjectsDidChangeNotification is sent during processPendingChanges. At the very least that happens at the end of every event loop automatically. Even if you've bypassed your event loop somehow you can still call p

Re: core data - delete of object.

2008-11-17 Thread Quincey Morris
On Nov 17, 2008, at 22:54, John Clayton wrote: I'm basically looking to restore some state on an object at time of deletion, e.g. if A is associated with B via a to-many relationship from A->B, then when one instance of B is deleted - we need to change a property on A. If a B is delete,

Re: core data - delete of object.

2008-11-17 Thread John Clayton
Thanks Jim, unfortunately all occur either at pre-save or save time, which is too late. I'm basically looking to restore some state on an object at time of deletion, e.g. if A is associated with B via a to-many relationship from A->B, then when one instance of B is deleted - we need to ch

Re: core data - delete of object.

2008-11-17 Thread Jim Correia
On Nov 17, 2008, at 4:51 PM, John Clayton wrote: I'm using core-data and need to know when a particular core-data object (derived from NSManagedObject of course) is about to be deleted. I'm deleting objects simply by using the managed object context's deleteObject method, like this:

core data - delete of object.

2008-11-17 Thread John Clayton
Hi All, I'm using core-data and need to know when a particular core-data object (derived from NSManagedObject of course) is about to be deleted. I'm deleting objects simply by using the managed object context's deleteObject method, like this: [[theObject managedObjectContext] del