Re: -[NSBundle URLForResource:withExtension:subdirectory] is case-sensitive
Re: -[NSBundle URLForResource:withExtension:subdirectory] is case-sensitive
- Subject: Re: -[NSBundle URLForResource:withExtension:subdirectory] is case-sensitive
- From: Ken Thomases <email@hidden>
- Date: Sat, 17 Aug 2013 20:07:12 -0500
On Aug 17, 2013, at 6:29 PM, Stephen J. Butler wrote:
> On Sat, Aug 17, 2013 at 6:03 PM, Rick Aurbach <email@hidden> wrote:
>
>> I expect indexURL to be non-null (and to contain the appropriate URL).
>> However, in actual devices, this function returns nil; on the IOS Simulator
>> it returns a valid URL. If I change the resource name to exactly match the
>> actual file name (i.e., change either the filename or the argument to
>> exactly match) I get a correct result on both the actual and simulated
>> devices
>
> This is a known limitation of the Simulator. On OS X the filesystem is case
> preserving, but not case sensitive. Since the Simulator runs on top of OS X
> it inherits this behavior.
It's worth noting that OS X can be configured to use a case-sensitive file system. That can be useful for testing. It's also something that you have to keep in mind as a Mac application developer. Your end users may be using a case-sensitive file system, so your app has to behave correctly. You have to watch out for inadvertent reliance on case-insensitivity sneaking into your code.
Regards,
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden