Skip to content

Instantly share code, notes, and snippets.

@incanus
Created August 10, 2011 18:33
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 incanus/1137725 to your computer and use it in GitHub Desktop.
Save incanus/1137725 to your computer and use it in GitHub Desktop.
NSArray *colorNames = [NSArray arrayWithObjects:@"red", @"blue", @"yellow", @"green", @"brown", @"purple", @"cyan", @"orange", @"magenta", nil];
NSMutableArray *madeColors = [NSMutableArray array];
for (int c = 0; c < [colorNames count]; c++)
[madeColors addObject:[[UIColor class] performSelector:NSSelectorFromString([NSString stringWithFormat:@"%@Color", [colorNames objectAtIndex:c]])]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment