Skip to content

Instantly share code, notes, and snippets.

@exce11ent
Created July 24, 2015 13:39
Show Gist options
  • Save exce11ent/884993168a2838f56af9 to your computer and use it in GitHub Desktop.
Save exce11ent/884993168a2838f56af9 to your computer and use it in GitHub Desktop.
- (instancetype)initWithElements:(id)firstObj, ... {
self = [self init];
if (self) {
va_list(args);
va_start(args, firstObj);
[_objects addObject:firstObj];
id obj;
while ((obj = va_arg(args, id)) != nil) {
[_objects addObject:obj];
}
va_end(args);
}
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment