Serialize Status Data from NSUndoManager on iPhone

I have a cancel / redo function in my iphone application and now I look at the save state, so when the user exits the application and then starts it again, everything is in the same state, including undo / redo. I do not see an obvious way to serialize NSUndoManager. Is there a good way to do this?

+3
source share
1 answer

Unfortunately, NSUndoManager does not provide access to its internal state. The best option is to simply write your own replacement override manager, or use an open source implementation like Graham Cox GCUndoManager . You will get access to the initial level, and just add support for NSCoding.

Alternatively, you can try to subclass NSUndoManager to support your separate serializable undo stack in addition to its normal database.

+3
source

Source: https://habr.com/ru/post/1740237/


All Articles