iphone - Creating an object, strange question -


i have class "projectiles", , want create object it. minimise code, want specify object string, clean thins alot.

example: have string,

tempenemy.atktype = @"homing_fireball"; 

now want create object same name projectiles class:

projectiles *tempenemy.atktype; 

is possible? final result object projectiles class called homing_fireball..?

thanks!!

i doubt possible. i'm not expert inner core of objective-c.

i suggest store projectile in nsmutabledictionary. store object key of @"homing_fireball". , can reference

projectile *someprojectile = [myprojectiles objectforkey:tempenemy.atktype]; 

Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -