• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
-[NSBundle URLForResource:withExtension:subdirectory] is case-sensitive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-[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


  • Follow-Ups:
    • Re: -[NSBundle URLForResource:withExtension:subdirectory] is case-sensitive
      • From: "Stephen J. Butler" <email@hidden>
  • Prev by Date: Re: predefined macro iOS vs OS X
  • Next by Date: Re: -[NSBundle URLForResource:withExtension:subdirectory] is case-sensitive
  • Previous by thread: Re: editing text part in a custom NSTextFieldCell (of a NSTableView)
  • Next by thread: Re: -[NSBundle URLForResource:withExtension:subdirectory] is case-sensitive
  • Index(es):
    • Date
    • Thread