Сравнить ...Почему prepareWithInvocationTarget: конкретный для NSUndoManager?
NSInvocation* invocation = [NSInvocation invocationWithMethodSignature:[performer methodSignatureForSelector:@selector(playFile:)]];
[invocation setSelector:@selector(playFile:)];
[invocation setTarget:performer];
NSString* string = [NSString stringWithString:@"reverse.wav"];
[invocation setArgument:&string atIndex:2];
... с ...
NSInvocation* invocation = [[NSInvocation prepareWithTarget:performer] playFile:@"reverse.wav"];
. Почему такой метод не реализован?
Вы можете сделать свой код более чистым, используя переменную для селектора 'SEL sel = @selector (playFile:)', которая также позволяет избежать замалчивания длинных имен селекторов и просто установить 'NSString * string = @" reverse.wav «' - вызов '-stringWithString:' не нужен. –