CoreData: avoiding unwanted undo states after refreshing manged object contexts?
CoreData: avoiding unwanted undo states after refreshing manged object contexts?
- Subject: CoreData: avoiding unwanted undo states after refreshing manged object contexts?
- From: Jim Correia <email@hidden>
- Date: Mon, 18 Jul 2005 14:59:16 -0400
I have a CoreData application which uses one managed object context
per editor window to isolate each window's edits into its own undo
manager.
When one context saves, the changes are synced into the other
context. Sometime after the refresh (but before the next user event)
a fetch request is executed in the synced context (in order to
repopulate one of the controllers.) This results in an "extra" (from
the user's perspective, since they didn't edit anything in this
window) being pushed onto the undo stack.
#0 0x9289a384 in -[NSUndoManager
registerUndoWithTarget:selector:object:] ()
#1 0x93fea438 in -[NSManagedObjectContext
(_NSInternalChangeProcessing) _processRecentChanges:] ()
#2 0x93feb760 in -[NSManagedObjectContext
executeFetchRequest:error:] ()
The registered selector appears to be _undoUpdates:.
Is there some way for me to avoid having this pushed on the undo
stack, or forcing it to happen from within my method which does the
syncing (where undo registration is already disabled)?
(FWIW, CoreRecipes appears to have the same problem. The app starts
"clean" with two undo states. If I open a recipe and change its name
then close it, there are now extra states on the undo manager for the
main window, but no edits have happened there from the user's
perspective.)
Thanks,
Jim
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden