Create objective-c class instance by name?

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2009-07-23T19:53:29Z Indexed on 2010/05/27 3:51 UTC
Read the original article Hit count: 453

Filed under:
|

Duplicate: http://stackoverflow.com/questions/1034350/dynamic-class-creation-in-objective-c/1034368#1034368

Is it possible to create an instance of a class by name? Something like:

NSString* className = @"Car";
id* p = [Magic createClassByName:className];
[p turnOnEngine];

I don't know if this is possible in objective-c but seems like it would be,

Thanks

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about reflection