Skip to content

Instantly share code, notes, and snippets.

@wjlafrance
Created June 18, 2012 23:51
Show Gist options
  • Save wjlafrance/2951508 to your computer and use it in GitHub Desktop.
Save wjlafrance/2951508 to your computer and use it in GitHub Desktop.
Class newClass = NSClassFromString(@"UINewClassThatYouCantHave");
if (newClass) {
NSLog(@"We're on an iOS that has the new class");
id newObject = [[newClass alloc] init];
if ([self respondsToSelector:@selector(selectorThatUsesNewObject:)])
[self performSelector:@selector(selectorThatUsesNewObject:) withObject:newObject];
} else {
NSLog(@"Class doesn't exist!");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment