• 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
Re: Loading images from subfolder of Resources
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading images from subfolder of Resources


  • Subject: Re: Loading images from subfolder of Resources
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Fri, 21 Jan 2005 04:43:56 +0100

At 21:33 Uhr -0600 20.01.2005, Ricky Sharp wrote:
Second, pathForResource is there for building the path, why would you pass the path to your image folder and the file name to NSBundle??? Just pass the name there instead.

When the images lived directly inside of the Resources folder, just passing the name was good enough. From my original post, I had mentioned I used pathForResource:ofType:. But now, I'm placing images in subfolders. Because I don't always know the extension, that's why I need to pass the root name of the image along with the folder that they live in. Furthermore, these functions do not recurse into any subfolders; that's why I need to specify the exact folder to look in.

You're not understanding me. You're not just passing a folder name, you're passing: [[aBundle resourcePath] stringByAppendingPathComponent:@"Images"], which is a full pathname. My guess would be that's why it doesn't work.


I'm also not sure you're allowed to pass NIL for the type. Certainly the docs don't mention that.

The docs do mention that nil (or the empty string) can be used. This instructs the method to search for the first resource that matches the name, regardless of extension.

Huh? You're right. I don't know how I overlooked that. Sorry for claiming something wrong.


--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
       "The Witnesses of TeachText are everywhere..."
                   http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Loading images from subfolder of Resources
      • From: Ricky Sharp <email@hidden>
References: 
 >Loading images from subfolder of Resources (From: Ricky Sharp <email@hidden>)
 >Re: Loading images from subfolder of Resources (From: "M. Uli Kusterer" <email@hidden>)
 >Re: Loading images from subfolder of Resources (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: Loading images from subfolder of Resources
  • Next by Date: re:re:NSComboBoxCell in an NSTableView
  • Previous by thread: Re: Loading images from subfolder of Resources
  • Next by thread: Re: Loading images from subfolder of Resources
  • Index(es):
    • Date
    • Thread