• 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: A distinct group of pictures in the bundle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A distinct group of pictures in the bundle


  • Subject: Re: A distinct group of pictures in the bundle
  • From: Ron Fleckner <email@hidden>
  • Date: Thu, 29 Oct 2009 17:02:46 +1100

When you add your folder of jpgs to your project, be sure to set "Create folder references for any added folders" to true. Also don't forget to check the checkbox with "Copy items into destination group's folder, if needed." Then you can do, for example:

NSString *bellSoundPath = [[NSBundle mainBundle] pathForResource:@"Cow Bell" ofType:@"aiff" inDirectory:@"Sounds"];

and it Just Works™.

Ron


On 29/10/2009, at 4:01 PM, Pierre Berloquin wrote:

I do use pathForResource:ofType:inDirectory: with nil for Directory and jpg
for Type
It helps separate jpg's from other pictures


But suppose I want to have my pictures in a directory called Pic, how do I
go about it?
Thanks Dave
Pierre


2009/10/28 Dave Carrigan <email@hidden>


On Oct 28, 2009, at 10:46 AM, Pierre Berloquin wrote:

My app uses a hundred pictures.
How can I group them somewhere in the bundle so that my app loads them
without confusing them with button images and icons .



Have you tried NSBundle's -pathForResource:ofType:inDirectory:

To install them, create a new copy files build phase that copies them to
the subdirectory of your choosing.


--
Dave Carrigan
email@hidden
Seattle, WA, USA




--
Blogs : http://bibliobs.nouvelobs.com/blog/jeux-litteraires
          http://pierre-berloquin.blogspot.com/

Développement durable des neurones par le jeu de réflexion
www.crealude.net

Sustainable development of neurones through mind games
www.crealude.net/us

Que fait-on pour les mal-codants ?
_______________________________________________

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

_______________________________________________

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: A distinct group of pictures in the bundle
      • From: Pierre Berloquin <email@hidden>
References: 
 >A distinct group of pictures in the bundle (From: Pierre Berloquin <email@hidden>)
 >Re: A distinct group of pictures in the bundle (From: Dave Carrigan <email@hidden>)
 >Re: A distinct group of pictures in the bundle (From: Pierre Berloquin <email@hidden>)

  • Prev by Date: Re: waiting for async callback in main thread
  • Next by Date: Showing activity indicator during data download
  • Previous by thread: Re: A distinct group of pictures in the bundle
  • Next by thread: Re: A distinct group of pictures in the bundle
  • Index(es):
    • Date
    • Thread