ios 不同路径加载 相同图片_iOS Objective-C图像文件名/路径在模拟器和设备之间的不同行为...

在iOS应用中,从bundle加载图片时遇到路径大小写敏感的问题。在iPod Touch设备上,图片文件名大小写必须严格匹配,而在模拟器中则不敏感。作者认为模拟器的行为可能是bug,并考虑向Apple报告。解决方案指出模拟器的文件路径不区分大小写可能才是真正的bug。
摘要由CSDN通过智能技术生成

I have an app in which the app bundle contains an image file (I mean that the file is dragged into XCode and appears in "Other Sources"), and I am using code like:

[[NSBundle mainBundle] pathForResource:@"Auto" ofType:@"jpg"]

to get a path to the image.

I found that when running on a device (iPod Touch), the name is case-sensitive, so that if the file is "Auto" and I use "AUTO", the poath returned is "file://(null)". However on the simulator, if I use "AUTO", it works the same as if I use "Auto".

I am thinking that the fact that the simulator has such a clear difference in behavior from the device is a bug. Do the more experienced users out there think that it is, and that I should report it to Apple?

Thanks.

解决方案I am thinking that the fact that the simulator has such a clear difference in behavior from the device is a bug.

In general, this does not necessarily indicate a bug.

Do the more experienced users out there think that it is, and that I should report it to Apple?

Yes. But the bug has nothing to do with the device at all. Specifically, the bug is simply "Simulator file paths are not case-sensitive". If you can reproduce this in a "sandbox" project, do so, and submit it along with your bug report.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值