• 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: Adding Resource Bundles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding Resource Bundles


  • Subject: Re: Adding Resource Bundles
  • From: David Dunham <email@hidden>
  • Date: Fri, 26 Aug 2005 08:47:16 -0700

Achal

#ifdef LINUX
loadTexture("images/image.bmp");
#else
loadTexture("MyApp.app/Contents/Resources/image.bmp");
#endif

I'm just curios now if there's a cleaner way of doing this? Perhaps some preprocessor variable for "MyApp.app/Contents/Resources"?

This will fail if any user renames your application (which they will do).

I guess you could write Mac-specific code to set the working directory to the Resources directory, using CFBundle routines.

I also recommend creating an images directory inside Resources, for better cross-platform compatibility (the #ifdef above would no longer be needed). I think Xcode can do this directly, but you can always make a script.
--


David Dunham     A Sharp, LLC
Voice/Fax: 206 783 7404     http://a-sharp.com
Efficiency is intelligent laziness.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Adding Resource Bundles
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Opening iChat .nib files with InterfaceBuilder fails
  • Next by Date: Re: Adding Resource Bundles
  • Previous by thread: Re: Adding Resource Bundles
  • Next by thread: Re: Adding Resource Bundles
  • Index(es):
    • Date
    • Thread