Re: Path To Folder Where App Is
Re: Path To Folder Where App Is
- Subject: Re: Path To Folder Where App Is
- From: Adam <email@hidden>
- Date: Mon, 21 Mar 2005 22:43:38 -0500
On Mar 21, 2005, at 10:40 PM, Charilaos Skiadas wrote:
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 /)?
I could, just figured there must be a way to get it directly.
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?
I have a folder named "boards" that is in the same folder as the app,
but its contents can not be stored in the bundle because the user makes
changes to its contents, I need to load files from this folder so I
need to tell my app the path to it relative to itself.
Adam
_______________________________________________
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