objective-c - 为什么prepareWithInitationTarget是: specific to NSUndoManager?

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

。为什么没有实现这样的方法?

最佳答案

事实并非如此,但不乏具有相同功能的第三方实现,例如为 Cocoa with Love 编写和创建的实现。 .

关于objective-c - 为什么prepareWithInitationTarget是: specific to NSUndoManager?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4035836/

相关文章:

iphone - becomeFirstResponder 第二次不显示键盘(ios 6 + Storyboard)

ios - privateQueue managedObjectContext 的奇怪问题

iOS - 开始 iOS 教程 - 变量前的下划线?

objective-c - 如何从 NSInvocation 获得 NSString 结果?

iphone - NSInvocation需要NSMethodSignature

ios - 如何在 objective c 中将 SOAP 数据发布到服务器

macos - Tiger 上的 NSGradient

objective-c - append 到 NSTextView

iphone - 验证 NSString 中是否存在单词

ios - 确定来自 NSInvocation getArgument 的 (void *) 指针是对象还是原语