• 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
CoreData: avoiding unwanted undo states after refreshing manged object contexts?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Special Borders
  • Next by Date: Re: Receiving key events in a new window
  • Previous by thread: Re: Receiving key events in a new window
  • Next by thread: Comparative Testing/Debugging
  • Index(es):
    • Date
    • Thread