• 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
pathForResource with nil Type
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pathForResource with nil Type


  • Subject: pathForResource with nil Type
  • From: Jeremy Dronfield <email@hidden>
  • Date: Tue, 10 Sep 2002 18:14:56 +0100

The NSBundle documentation for -pathForResource:ofType: says that "If the extension argument is nil or an empty string, the resource sought is identified by name, with no extension". Well, I'm passing it an empty string for Type, and it's handing me back an empty path:

path = [[NSBundle mainBundle] pathForResource:fileToGet ofType:@""];
[textView readRTFDFromFile:path];

RUN LOG ERROR:
-[NSURL initFileURLWithPath:]: must supply a non=empty path

The reason I want to do this, BTW, is so I can load either rtf or rtfd files into textView with the same method. Why isn't -pathForResource: finding my resource files?

-Jeremy

========================================
email@hidden // email@hidden
The Alchemy Pages:
- fractious fiction at http://freespace.virgin.net/jeremy.dronfield
========================================
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: pathForResource with nil Type
      • From: Andy Lee <email@hidden>
  • Prev by Date: Re: file extensions
  • Next by Date: Re: IB and smb volumes
  • Previous by thread: Re: IB and smb volumes
  • Next by thread: Re: pathForResource with nil Type
  • Index(es):
    • Date
    • Thread