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

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -