Re: FW: NSFileManager
Re: FW: NSFileManager
- Subject: Re: FW: NSFileManager
- From: Brian Webster <email@hidden>
- Date: Sun, 24 Jun 2001 14:13:51 -0500
On Sunday, June 24, 2001, at 12:46 PM, cocoa-dev-
email@hidden wrote:
I am trying to use NSFileManager to get the current working
directory path from a Cocoa application. I don't want to throw
up a file chooser as I am trying to read a preferences file
from within my application package. Whenever I use the
following code the output is "/" when I run the application by
double-clicking.
I guess the Finder doesn't specify a current directory for apps
when it launches them, so the default "/" is used, whereas
Project Builder does launch the app with a current directory
set. Anyway, if you're trying to access a file that's inside
your app package, you should use the NSBundle class instead of
NSFileManager. If you want to work with preferences files that
can differ from user to user, you should use NSUserDefaults.
--
Brian Webster
email@hidden
http://www.owlnet.rice.edu/~bwebster