I am trying to work with NSUndoManager's prepareWithInvocationTarget. I would like to have something like
[[self.undoManager prepareWithInvocationTarget:self] doSomethingWithObject:[self.aMutableArray objectAtIndex:0]]
where the argument of doSomethingWithObject
is not evaluated until the undo
method is called. In other words I don't want the argument to be the current first element of aMutableArray
, but the first element of aMutableArray
at the time of undo
.
Is there a particular part of NSInvocation or NSMethodSignature that I should look at?