iPhone开发--模拟器上能显示图片,而设备上不能显示图片

转自:http://blog.csdn.net/zcl369369/article/details/7380354

iPhone开发--模拟器上有图片,而设备上无图片这个问题之前遇到过,发现是程序中的图片和图片文件的大小写不一致造成的,后来改了大小写就好了。一直没找到官方的解释,在看Learn iPhone and iPad Cocos2D Game Development的时候,在书中的第56页找到了答案。记录下,共勉之。


警告:iOS设备上的文件名是区分大小写的!在模拟器上测试时并不区分大小写。

但是在iOS设备上实际测试时,程序就会因为大小写错误而崩溃。这个要求导致了很多让开发者头痛的问题,这也是另一个为什么要经常在设备上做实际测试的原因。为自己确立一个文件命名规则,并且坚持用下去。对我自己而言,我全部使用小写,词和词之间则用下划线分开。



WARNING:File names are case-sensitive on iOS devices! While you’re on the simulator, the filename’s case doesn’t matter but when you switch over to testing on the device, it will most likelycrash if the file name is actually something like @“default.PNG”, as in the example.

This has caused many developers serious headaches and it’s another reason you should test onthe device often. It’s also a good idea to come up with a naming scheme for file names and stickto it. Personally, I keep them in lowercase, using dashes where needed to separate words.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值