문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top