• 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: FW: NSFileManager
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Confusion
  • Next by Date: Re: Confusion
  • Previous by thread: Re: FW: NSFileManager
  • Next by thread: Re: NSFileManager
  • Index(es):
    • Date
    • Thread