views:

12

answers:

1

Example:

[[managedObjectContext undoManager] disableUndoRegistration];
// changes which shouldn't be undo-able
[managedObjectContext processPendingChanges];
[[managedObjectContext undoManager] enableUndoRegistration];

Is that really important? What's the point?

+2  A: 

This is an advanced feature.

There maybe times when you don't want to allow an undo for some change. Usually, this is because you are making a change that has a lot of side effects for the object graph and you don't what the undo overloaded with a having to remember a big chunk of the altered graph. Some models are so complex that undo functionality can be dangerous. Other times, you may just want the app to forget something without a chance of recovery such as with security related information.

TechZen