Originally posted by djcornell:
<STRONG>i need to see if a file exists in a directory where my app double clicked from, how do i determine this directory? I was using currentDirectoryPath but this only works from the debugger.[/LIST]</STRONG>
I don't think the Finder sets the current working directory to anything useful when a user double-clicks your program to launch it. So the getting the current directory is useless.
Assuming you're writing a Cocoa application stored in an application bundle (directory called MyApp.app) you can use the following to find your path:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
NSString *pathname = [[NSBundle mainBundle] bundlePath];
</font>[/code]
If I remember correctly, the returned string will be the full pathname for the application bundle (ie. /Applications/MyApp.app)