如何编写NSArray
值以利用类似于此的变量NSString
:
Levelname=[NSString stringWithFormat:@"Background1Level%d.png",LevelNO];
[backgroundimagview setImage:[UIImage imageNamed:Levelname]];
这是我需要转换以使用 LevelNO 变量的代码块:
[character setImage:[UIImage imageNamed:@"character1_09.png"]];
character.animationImages=[NSArray arrayWithObjects:
[UIImage imageNamed:@"character1_01.png"],
[UIImage imageNamed:@"character1_02.png"],
[UIImage imageNamed:@"character1_03.png"],
[UIImage imageNamed:@"character1_04.png"],nil ];