Re: Undo and Core Data issue

2008-03-05 Thread Michael Latta
It was separate undo managers. I overrid the undoManager method of the view to use the one from the document and things are working now. Thanks for the help in what to check. Michael On Mar 5, 2008, at 7:53 PM, Ben Trumbull wrote: At 6:58 PM -0800 3/5/08, Michael Latta wrote: The calls

Re: Undo and Core Data issue

2008-03-05 Thread Michael Latta
I just ran a test where I commented out the calls that start/end grouping. Now the undo menu item is not enabled. This suggests that either the UI is not using the same undo manager as CoreData, or the changes are not being recorded. Back to the documentation. Michael On Mar 5, 2008, a

Re: Undo and Core Data issue

2008-03-05 Thread Michael Latta
Here are the accessor methods I use for the property: - (NSData*)transform { [self willAccessValueForKey:@"transform"]; NSData *result = [self primitiveValueForKey:@"transform"]; [self didAccessValueForKey:@"transform"]; return result; } - (void)setTransform:(NSD

Re: Undo and Core Data issue

2008-03-05 Thread Ben Trumbull
At 6:58 PM -0800 3/5/08, Michael Latta wrote: The calls are on the Will/Did undo/redo notifications not the KVO callbacks on object changes. Ah, okay. There shouldn't be any need to call -processPendingChanges there, unless you're programmatically working with your own undo groups. What I

Re: Undo and Core Data issue

2008-03-05 Thread Michael Latta
The calls are on the Will/Did undo/redo notifications not the KVO callbacks on object changes. I can account for the number of undo entries (the menu item disables at the right time), but would not mind pointers on how to detect what the undo changes. I am not getting notifications from th

Re: Undo and Core Data issue

2008-03-05 Thread Ben Trumbull
I call processPendingChanges from both the *Will* and *Did* notifications. Please stop. It doesn't make sense for the context to coalesce pending changes in the middle of the change to a single object during the KVO callbacks. Your original problem description is a bit sparse. Common probl

Re: Undo and Core Data issue

2008-03-04 Thread Michael Latta
I call processPendingChanges from both the *Will* and *Did* notifications. Michael On Mar 4, 2008, at 8:45 PM, Dave Fernandes wrote: Did you also call processPendingChanges before trying to undo? You may get flakey undo behavior if not. On Mar 4, 2008, at 11:31 PM, Michael Latta wrote: I

Re: Undo and Core Data issue

2008-03-04 Thread Dave Fernandes
Did you also call processPendingChanges before trying to undo? You may get flakey undo behavior if not. On Mar 4, 2008, at 11:31 PM, Michael Latta wrote: I have a Core Data based application that is running into issues with Undo/Redo. When I select undo the notifications for Undo happen, b

Undo and Core Data issue

2008-03-04 Thread Michael Latta
I have a Core Data based application that is running into issues with Undo/Redo. When I select undo the notifications for Undo happen, but the values in the managed object do not change. I have tried adding processPendingChanges in the notification handler, but that did nothing. The valu