I have questions about the NSUndoManager methods
registerUndoWithTarget:selector:object:
prepareWithInvocationTarget:
Usually in examples, the "target" is a controller object that manages all the model objects (usually in an array).
But can the target be an individual model object - the model object to be changed by the undo/redo operation?
The guide says about registerUndoWithTarget:selector:object:
:
The target object may not be the actual object whose state is changing; instead, it may be the client object, a document or container that holds many undoable objects.
Why this restriction? It is not mentioned in the documentation for the method itself. Also, no such restriction is mentioned for the prepareWithInvocationTarget:
method.