views:

23

answers:

1

So the issue: I drop a some items into an editor area it creates an undo grouping...under the covers, as the whole process of dropping the items is actually a collection of tasks. If I then delete the tasks, I am given an option to undo the delete.

If I do this undo I get an error in the console: _endUndoGroupRemovingIfEmpty:: NSUndoManager 0x343f5a0 is in invalid state, endUndoGrouping called with no matching begin

It does return all the items back into the view, however... from this point my undo stack are messed up and dont do things right. REDO doesn't even work from this point on.

I have also tried this with only deleting one item out of the workflow... and then undoing the delete... the error is still thrown.

So two issues: 1. why is the error happening. 2. why does my redo not function correctlty, aka at all?

Thanks for any help

A: 

The issue was that I was willChange and didChange some KVO values within the -undoManagerDidUndoOrRedo... and that is a notification that is triggered when the undo manager completes an undo operation, inside that notification (internal to the state of the undo system)... so I was creating some nested changes incorrectly... which messed up my undo stack.

theprojectabot