if (NSClassFromString(className) != nil) {
id theInstance = [[NSClassFromString(className) alloc] init] autorelease];
}
Sunday, November 8, 2009
Creating an instance of a class from a string
If you need to create an instance of an Objective C class from a string indicating the class' name:
Subscribe to:
Posts (Atom)