문제

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