Created
July 22, 2009 07:22
-
-
Save ento/151861 to your computer and use it in GitHub Desktop.
How to access a variadic argument in Objective-C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)variadic:(NSString*)strings, ... { | |
va_list lst; | |
NSString* each; | |
va_start(lst, strings); | |
while (each = va_arg(lst, NSString*)) { | |
[NSString stringWithString: each]; | |
} | |
va_end(lst); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment