iOS Objective-C图像文件名/路径在模拟器和设备之间的不同行为
我有一个应用程序包中包含图像文件的应用程序(我的意思是该文件被拖入XCode并显示在其他来源中),我使用的代码如下:
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"]
获取图像的路径。
我发现在设备(iPod Touch)上运行时, name是区分大小写的,因此如果文件是Auto并且我使用AUTO,则返回的poath是file://(null)。但是在模拟器上,如果我使用AUTO,它就像我使用Auto一样。
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".
我认为模拟器有这样的事实与设备的行为明显不同是一个错误。那些经验丰富的用户是否认为它是,并且我应该向Apple报告?
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?
谢谢。
我认为模拟器与设备的行为有明显不同的事实是一个错误。
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.
那些经验丰富的用户认为它是,并且我应该向Apple报告?
Do the more experienced users out there think that it is, and that I should report it to Apple?
是的。但该bug根本与设备无关。具体来说,错误只是模拟器文件路径不区分大小写。如果您可以在沙盒项目中重现这一点,请执行此操作,并将其与错误报告一起提交。
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.