Hi, I use an xml file to store the level info for my game. the xml looks like
<level1 num="5" hp="25" file="snow"/>
I can get the value for num and hp successfully, but the problem is about string, the code is
int num = [[attributesDict valueForKey:@"num"] intValue];
...
NSString *file = [attributesDict valueForKey:"file"];
Sprite *sprite = [Sprite spriteWithFile:[file stringByAppendingPathExtension:@"png"]] // something wrong here
And I have tested [[file stringByAppendingPathExtension:@"png"] isEqualToString:@"snow.png"]] // is true
so, what is the problem? help me plz!