Sending / Forwarding variable arguments in ObjectiveC

Posted by Authman Apatira on Stack Overflow See other posts from Stack Overflow or by Authman Apatira
Published on 2012-06-07T04:30:17Z Indexed on 2012/06/07 4:40 UTC
Read the original article Hit count: 108

I know this is possible in other programming languages. Suppose we have the following arrangement:

- (void) myMethod:(NSString*)variables, ... {
    // Handle business here.
}

- (void) anotherMethod:(NSString*)variables, ... {
    // We want to pass these variable arguments for handling
    [self myMethod:variables, ...]; // Do not pass GO
}

// Start the party:
[self anotherMethod:@"arg1", @"arg2", @"arg3", @"arg4", nil];

What's the trick to get this working in ObjC?

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about variables