Skip to content

Instantly share code, notes, and snippets.

@zoul
Created March 19, 2010 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoul/337500 to your computer and use it in GitHub Desktop.
Save zoul/337500 to your computer and use it in GitHub Desktop.
Variable arguments in Objective-C
- (void) processStrings: (NSString*) str1, ...
{
va_list args;
va_start(args, str1);
NSString *arg = str1;
while (arg != nil) {
// do something with arg
arg = va_arg(args, NSString*);
}
va_end(args);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment