为什么prepareWithInvocationTarget:特定于NSUndoManager?

时间:2010-10-27 17:15:31

标签: objective-c cocoa nsinvocation

...比较

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"];

。为什么不实施这样的方法?

1 个答案:

答案 0 :(得分:2)

它不是,但是并不缺少相同功能的第三方实现,例如为Cocoa with Love编写和创建的实现。