Invocation-based Undo Manager in Swift [duplicate]
问题 This question already has answers here : NSUndoManager casting NSUndoManagerProxy crash in Swift code (2 answers) Closed 2 years ago . I'm having trouble adopting the more complex invocation-based approach to undo registration in Swift (based on NSHipster article here. Apple's docs still have all sample code in Objective-C, and the semantics are very different for the invocation setup). My NSDocument subclass Document has the following method that operates on the model objects, which I wish