• 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: Proper way to initialize application support file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proper way to initialize application support file


  • Subject: Re: Proper way to initialize application support file
  • From: Stuart Malin <email@hidden>
  • Date: Thu, 18 Feb 2010 07:37:20 -0500

On Feb 18, 2010, at 12:30 AM, Paul Johnson wrote:

> I see the data I get from the internet as not in the strictest sense
> 'necessary' for the program to run, just that it would be unable to do
> very much without it. So using my loose definition, the Application
> Support folder would be the place to create my data file.

This does not to me sound like a loose definition, and in my opinion this is exactly the kind of circumstance in which you should use the Application Support folder. If that data is specific to a user, then put it in ~/Application Support/appInfo. You can (and should) get the path for such directories  from NSPathUtilities:

For the system's Application Folder:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSSystemDomainMask, YES);
s = [paths objectAtIndex:0];

For the user's Application Folder:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);
s = [paths objectAtIndex:0];

NSSearchPathForDirectoriesInDomains is described in Foundation Functions Reference. Values for the parameters (NSSearchPathDirectory and NSSearchPathDomainMask) are described in  the Foundation Data Types Reference. Or just look at the enums declared in NSPathUtilities.h


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: NSTableViewDataSource Protocol
  • Next by Date: Re: NSTableViewDataSource Protocol
  • Previous by thread: Re: Proper way to initialize application support file
  • Next by thread: Stuck on NSTreeController bindings
  • Index(es):
    • Date
    • Thread