reflection - Create objective-c class instance by name? -
Is it possible to make an example of a square based on the name? Something like this:
NSString * className = @ "car"; Id * p = [create magic class: name: className]; [P turnOnEngine];
I do not know that this is possible in Objective-C, but it seems that it will,
ID object = [[NSClassFromString (@" NameofClass ") alloc] init];
Comments
Post a Comment