• 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: Path To Folder Where App Is
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Path To Folder Where App Is


  • Subject: Re: Path To Folder Where App Is
  • From: Charilaos Skiadas <email@hidden>
  • Date: Mon, 21 Mar 2005 21:40:09 -0600

On Mar 21, 2005, at 9:28 PM, Adam wrote:

I am trying to get the path to the folder where my application is.

I have tried [[NSFileManager defaultManager] currentDirectoryPath] which works great during a run inside of xcode, but returns the root of the hard drive when the app launches on its own.

[[NSBundle mainBundle] executablePath]  returns
/Users/adam/Desktop/AGFIBS .0002/build/AGFIBS1.app

I assume you meant [[NSBundle mainBundle] bundlePath] here? can't you just remove the application name part from this path (i.e. everything after the last /)?


and

[[NSBundle mainBundle] executablePath] returns
/Users/adam/Desktop/AGFIBS .0002/build/AGFIBS1.app/Contents/MacOS/AGFIBS1



The path I want is /Users/adam/Desktop/AGFIBS .0002/build/

If there is a method to do this directly, I don't know it. Why do you need it if I may ask?


Haris

_______________________________________________
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: Path To Folder Where App Is
      • From: Adam <email@hidden>
References: 
 >Path To Folder Where App Is (From: Adam <email@hidden>)

  • Prev by Date: Path To Folder Where App Is
  • Next by Date: Re: Path To Folder Where App Is
  • Previous by thread: Path To Folder Where App Is
  • Next by thread: Re: Path To Folder Where App Is
  • Index(es):
    • Date
    • Thread