I have a method which take variable arguments something like this, the arguments end with nil.
-(void)manyParams:(NSString *)st, ... {
va_list argList;
va_start(argList,st);
id obj;
while ((obj = va_arg(argList, id))) {
NSLog(@"%@",obj);
}
va_end(argList);
return;
}
I can call it directly like this
[self manyParams:@"one",@"two",@"three",nil];
If I am using NSInvocation
class to invoke the manyParams then how can I do this
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
[invocation setTarget:self];
[invocation setSelector:@selector(manyParams:)];
///NSString *one = @"one";
///[invocation setArgument:&one atIndex:2]; //////How to pass variable arguments like @"one",@"two",@"three", nil
[invocation invoke];