I want to disable undo in Core Data. So far I can think of two ways to do that.



1) In awakeFromNib, call either   [[self managedObjectContext] 
setUndoManager:nil];   or  [[[self managedObjectContext] undoManager] 
disableUndoRegistration];   This certainly works, but the problem with this is 
that the   NSManagedObjectContextObjectsDidChangeNotification  will stop being 
sent when the context changes! This is not an option for me, as I rely on this 
notification a lot throughout my app. How come this notification is so 
dependent on having undo turned on? Seems weird to me that turning undo off 
would stop change notifications being sent out.



2) Which brings me to the second option. Keep the undo stuff there so that the 
NSManagedObjectContextObjectsDidChangeNotification will properly be sent out, 
as I want. However, instead just get rid of the Undo and Redo menu items. How 
good is this solution?



Therefore, method 1) isn't an option for me as I stop receiving notifications 
of changes. 2) might be an option, but might be a bad one in case I would one 
day like to add undoing for some selected feature in my app.



What do you all think?




--.
_________________________________________________________________
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to