re: Core Data: consequences of disabling the undoManager
re: Core Data: consequences of disabling the undoManager
- Subject: re: Core Data: consequences of disabling the undoManager
- From: Ben Trumbull <email@hidden>
- Date: Fri, 8 Feb 2008 15:45:10 -0800
I have had big problems with CD and undo.
It would be helpful to file concrete suggestions with bugreport.apple.com
The core of the problem is that when undo/redo happens I have no
idea what happened
What in particular do you have no idea about ? KVO notifications are
posted. Please send that to bugreport.apple.com
I tried to observe the managed objects, but it was too difficult to get
fine grained notifications of the changes
There are KVO notifications for every property that changes. How
much more fine grained do you want ?
and more importantly if you undo to a time before the object existed
your observer is gone.
... yes and ? How would you define the semantics of that ?
What is the safest way to turn off undo in Core Data?
The best way to permanently disable it is to set the MOC's undo manager to nil.
I have tried setting the managedObjectContext's undoManager to nil in the
persistantdocuement init.
This appears to work, but my document seems to be out of sync when I save, or
worse sometimes its completely empty! I guess this is not the safest thing to
do.
The templates for persistent document apps use a single undo manager
for both the MOC and the document. To disable just Core Data's, you
only want a nil undo manager on the MOC. You need to have the
document use it's own undo manager, not ask the MOC (as it does by
default)
Will this also cause problems?
No.
--
-Ben
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden