Skip to content

Instantly share code, notes, and snippets.

@hjazz
Created April 21, 2014 11:55
Show Gist options
  • Save hjazz/11140626 to your computer and use it in GitHub Desktop.
Save hjazz/11140626 to your computer and use it in GitHub Desktop.
NSArray to va_list
NSArray *locArgs = // from alert "loc-args"
NSRange range = NSMakeRange(0, [locArgs count]);
NSMutableData* data = [NSMutableData dataWithLength: sizeof(id) * [locArgs count]];
[locArgs getObjects: (__unsafe_unretained id *)data.mutableBytes range:range];
NSString *message = [[NSString alloc] initWithFormat:NSLocalizedString(locKey, nil) arguments:data.mutableBytes];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment