Why is prepareWithInvocationTarget: specific to NSUndoManager?
-
26-09-2019 - |
Question
Compare...
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];
...with...
NSInvocation* invocation = [[NSInvocation prepareWithTarget:performer] playFile:@"reverse.wav"];
. Why isn't such a method implemented?
Solution
It just isn't, but there is no shortage of third-party implementations of the same functionality, such as the one written up at and created for Cocoa with Love.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow