Why should I call -processPendingChanges when blocking things from undo-registration?
Example:
[[managedObjectContext undoManager] disableUndoRegistration];
// changes which shouldn't be undo-able
[managed开发者_如何学GoObjectContext processPendingChanges];
[[managedObjectContext undoManager] enableUndoRegistration];
Is that really important? What's the point?
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.
精彩评论