How can i set up a specific Redo action the same i setup Undo actions when using prepareWithInvocationTarget
using my approach, the redo doesn't work (undo works)
- (void)removeSmth:(Smth *)smth index:(NSInteger)indexOfSmth {
[self.document.undoManager beginUndoGrouping];
...
[self removeSmth:smth];
[[self.document.undoManager prepareWithInvocationTarget:self] undoInsertSmth:smth index:indexOfSmth];
...
[self.document.undoManager endUndoGrouping];
}
- (void)undoInsertSmth:(Smth *)smth index:(NSUInteger)index {
[self insertSmth:smth index:index];
}