Undo and Redo
The Application Kit includes a powerful and flexible system to implement undo and redo operations by taking advantage of the Objective-C runtime to record the messages sent to objects and play them back later. Many Application Kit classes including the text management views already implement undo and redo.
Each instance of the NSDocument class optionally includes an instance of NSUndoManager. The NSUndoManager class stores recorded messages and works with the standard Undo and Redo menu items. NSUndoManager is actually part of the Foundation framework because nongraphical applications might include undoable operations. The NSUndoManager class can be used without the NSDocument class and visa versa, but using them together automatically ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access