Create object from NSString of class name in Objective-C

Classes are first-class objects in Objective-C too. You can get the class object from an NSString with the NSClassFromString function.

[[NSClassFromString(className) alloc] init...]

Leave a Comment