I am working on a basic data application that has a fairly large hierarchy of tree-like managed objects.
When a base object is created, it creates several child objects, which, in turn, create their own child objects, etc. Each of these children can collect information using NSURLConnections.
Now I would like to support undo / redo with undoManager in the managedObjectContext file. The problem is that if the user creates the base object, then he tries to cancel this action, the base object will not be deleted. Instead, one or more child objects may be deleted. Obviously, this type of action is unpredictable and undesirable.
So I tried to disable default deregistration. I did this by calling disableUndoRegistration: before anything was changed in the managedObjectContext file. Then, allowing you to unregister before basic operations, such as creating a base object, again turn off the registration of afterwords.
Now when I try to cancel, I get this error:
cancel: NSUndoManager 0x1026428b0 is in an invalid state, canceled caused by too many nested cancellation groups
Thoughts?
Arlen anderson
source share