I am developing an IOS app. I need a functionality that includes undo and reset. It seems quite simple to perform an undo on the last operation. However I can't find any built in support for resting to the first stored undo operation.

My question is, how can I pop the first undo action and reset my view accordingly? Thank you

有帮助吗?

解决方案

Depending on what you're doing, the implementation might be different, but the documentation for NSUndoManager can be found here.

If you just want to undo the last group of actions, call undoNestedGroup.

If you want to undo everything, you could make a while loop that tested canUndo, and if that returned YES, called undo.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top