Skip to content

Instantly share code, notes, and snippets.

@seanh
Created August 8, 2011 13:51
Show Gist options
  • Select an option

  • Save seanh/1131769 to your computer and use it in GitHub Desktop.

Select an option

Save seanh/1131769 to your computer and use it in GitHub Desktop.
// Class objects are loaded into a dictionary.
factories = [NSMutableDictionary new];
[factories setObject:[SomeClass class] forKey:@"some string"];
.
.
.
// Later, a class from the dictionary is used to init a new object.
Class someClass = [factories objectForKey:someString];
id newObject = [someClass new];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment