• 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: resources in App Bundles. Nearly there.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resources in App Bundles. Nearly there.


  • Subject: Re: resources in App Bundles. Nearly there.
  • From: Rush Manbert <email@hidden>
  • Date: Thu, 19 Jun 2008 13:50:56 -0700


On Jun 19, 2008, at 1:13 PM, Josh de Lioncourt wrote:

Hello all,

Thanks for the help.  I've got the program up and running now at least.  I need two very simple pieces of information that I've yet to be able to discover.  I suspect these will be simple questions to veterans of XCode/Mac development, but if you could just provide the answers to them, I'll be well on my way to getting these projects done at last.

1. When using an install script, how does one reference files that are included within the app bundle.  Below is my current script, which points to a file in the build directory of the project.  I want it to point to a file included in the app bundle instead.  The script is:

install_name_tool -change /usr/local/lib/libirrklang.dylib @executable_path/libirrklang.dylib "$TARGET_BUILD_DIR/libirrklang.dylib"

2. THe second question is related.  I'd like to be able to reference files that are also included in the app bundle from within my code.  I need a path to supply to the function, so am not sure how to obtain the path to the innards of the bundle.  Here's an example:

engine->play2D("/users/joshdelioncourt/dev/ProofOfConcept/sound.wav");

This correctly works for files outside the bundle.  How can I provide a path to files included in the package?

Hi Josh,

Glad to hear it's going so well.

No answer for #1, but I think this works for #2:

NSBundle *pMainBundle = [NSBundle mainBundle];
NSString *pBundlePath = [pMainBundle bundlePath];

pBundlePath has the fully qualified path to the app bundle. Use it as the base for stuff inside.

- Rush
 _______________________________________________
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

References: 
 >resources in App Bundles. Nearly there. (From: Josh de Lioncourt <email@hidden>)

  • Prev by Date: resources in App Bundles. Nearly there.
  • Next by Date: Re: resources in App Bundles. Nearly there.
  • Previous by thread: resources in App Bundles. Nearly there.
  • Next by thread: Re: resources in App Bundles. Nearly there.
  • Index(es):
    • Date
    • Thread