Я не понимаю, почему мы должны вызывать метод setSelector для объектов NSInvocation, когда эта информация уже передана через invocationWithMethodSignature.
Чтобы создать объект NSInvocation, мы делаем следующее:
SEL someSelector;
NSMethodSignature *signature;
NSInvocation *invocation;
someSelector = @selector(sayHelloWithString:);
//Here we use the selector to create the signature
signature = [SomeObject instanceMethodSignatureForSelector:someSelector];
invocation = [NSInvocation invocationWithMethodSignature:signature];
//Here, we again set the same selector
[invocation setSelector:someSelector];
[invocation setTarget:someObjectInstance];
[invocation setArgument:@"Loving C" atIndex:2];
Обратите внимание, что мы передали селектор в [SomeObject instanceMethodSignatureForSelector: someSelector]; и снова на [invocation setSelector:someSelector];.
Есть ли что-то, что мне не хватает?