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

email - PHP mail error ... failed to open stream : permission denied -

c# - ListView onScroll event -

c - Linux mmap() error -