-[NSBundle URLForResource:withExtension:subdirectory] is case-sensitive
-[NSBundle URLForResource:withExtension:subdirectory] is case-sensitive
- Subject: -[NSBundle URLForResource:withExtension:subdirectory] is case-sensitive
- From: Rick Aurbach <email@hidden>
- Date: Sat, 17 Aug 2013 19:03:56 -0400
- Acceptlanguage: en-US
- Thread-topic: -[NSBundle URLForResource:withExtension:subdirectory] is case-sensitive
I just filed the following radar and I thought I'd share it. (Of course, if this is one of those things that "everybody knows", please be kind.)
rdar://14766402
-[NSBundle URLForResource:withExtension:subdirectory] is case sensitive
Create a file named "Index.html" (notice the leading 'I' is capitalized). Place the file somewhere inside the application bundle. Examine the result of the following statement (where self.helpFolderName describes the folder containing the file).
NSURL * indexURL = [[NSBundle mainBundle] URLForResource:@"index" withExtension:@"html" subdirectory:self.helpFolderName];
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.
Cheers,
Rick Aurbach
Aurbach & Associates, Inc.
_______________________________________________
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