Question

I know that NSUndoManager clears the redo stack as soon as one registers a new undo operation. Is there an elegant way to prevent the redo stack from being cleared for "n" number of undo operations? I do not want to disable registration of undo operations. I only want to prevent the redo stack from being cleared.

Update: I really liked the functionality that NSUndoManager provided. So I ended up using two NSMutableArrays for the stacks and used NSInvocation to do the stack pop and push. How can I provided feedback to Apple?

Was it helpful?

Solution

Unfortunately, I don't know of any way to prevent the redo stack being cleared. The semantics of NSUndoManager don't allow for anything like that. If you want to have a more complex undo/redo tree, you'll need to implement your own or find an open-source solution on the web.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top