比较...
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"];
。为什么没有实现这样的方法?
最佳答案
事实并非如此,但不乏具有相同功能的第三方实现,例如为 Cocoa with Love 编写和创建的实现。 .
关于objective-c - 为什么prepareWithInitationTarget是: specific to NSUndoManager?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4035836/