如何简化我的代码 - UIImage imageNamed:
更多 iPhone 内容... 有谁知道我如何削减这段代码。 所以我不必写每一个图像。
多谢
bMon01.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"mon01_0001.png"],
[UIImage imageNamed:@"mon01_0002.png"],
[UIImage imageNamed:@"mon01_0003.png"],
[UIImage imageNamed:@"mon01_0004.png"],
[UIImage imageNamed:@"mon01_0005.png"],
[UIImage imageNamed:@"mon01_0006.png"],
[UIImage imageNamed:@"mon01_0007.png"],
[UIImage imageNamed:@"mon01_0008.png"],
[UIImage imageNamed:@"mon01_0009.png"],
[UIImage imageNamed:@"mon01_0010.png"],
[UIImage imageNamed:@"mon01_0011.png"],
[UIImage imageNamed:@"mon01_0012.png"],
[UIImage imageNamed:@"mon01_0013.png"],
[UIImage imageNamed:@"mon01_0014.png"],
[UIImage imageNamed:@"mon01_0015.png"],
[UIImage imageNamed:@"mon01_0016.png"],
[UIImage imageNamed:@"mon01_0017.png"],
[UIImage imageNamed:@"mon01_0018.png"],
[UIImage imageNamed:@"mon01_0019.png"],
[UIImage imageNamed:@"mon01_0020.png"],
[UIImage imageNamed:@"mon01_0021.png"],
[UIImage imageNamed:@"mon01_0022.png"],
[UIImage imageNamed:@"mon01_0023.png"],
[UIImage imageNamed:@"mon01_0024.png"],
[UIImage imageNamed:@"mon01_0025.png"], nil];
More iPhone stuff...
Does anyone know how I can trim this code down. So I don't have to write every single image.
Thanks a lot
bMon01.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"mon01_0001.png"],
[UIImage imageNamed:@"mon01_0002.png"],
[UIImage imageNamed:@"mon01_0003.png"],
[UIImage imageNamed:@"mon01_0004.png"],
[UIImage imageNamed:@"mon01_0005.png"],
[UIImage imageNamed:@"mon01_0006.png"],
[UIImage imageNamed:@"mon01_0007.png"],
[UIImage imageNamed:@"mon01_0008.png"],
[UIImage imageNamed:@"mon01_0009.png"],
[UIImage imageNamed:@"mon01_0010.png"],
[UIImage imageNamed:@"mon01_0011.png"],
[UIImage imageNamed:@"mon01_0012.png"],
[UIImage imageNamed:@"mon01_0013.png"],
[UIImage imageNamed:@"mon01_0014.png"],
[UIImage imageNamed:@"mon01_0015.png"],
[UIImage imageNamed:@"mon01_0016.png"],
[UIImage imageNamed:@"mon01_0017.png"],
[UIImage imageNamed:@"mon01_0018.png"],
[UIImage imageNamed:@"mon01_0019.png"],
[UIImage imageNamed:@"mon01_0020.png"],
[UIImage imageNamed:@"mon01_0021.png"],
[UIImage imageNamed:@"mon01_0022.png"],
[UIImage imageNamed:@"mon01_0023.png"],
[UIImage imageNamed:@"mon01_0024.png"],
[UIImage imageNamed:@"mon01_0025.png"], nil];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这会有所帮助吗:
Will this help: