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?

Was it helpful?

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
scroll top