For example i have a class named “WaterScene”, in the .xml i have saved as string “WaterScene” when i read the .xml i have to convert that string to class. One approach is just string comparison
if( string == "WaterScene")
return new WaterScene;
Is there any generic way to do this to avoid string comparison? Like in objective C(dynamic language) we can get the class using string…
Class classObject =[[NSBundle mainBundle] classNamed:string];
I have used Generic Class factory to solve the issue… First i am registering class and storing it in a map before main().