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
Post a Comment