• 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: Best Place To Save States
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best Place To Save States


  • Subject: Re: Best Place To Save States
  • From: Paul Lynch <email@hidden>
  • Date: Fri, 28 Apr 2006 16:51:55 +0100


On 28 Apr 2006, at 16:42, Jerrod Fowkes wrote:

Hello, I need the ability to save off a state for my application. By that I mean I need to remember some data that was filled in on my form. Currently I am using the main bundle to load Images at runtime. With that, I need the ability to write to a file somewhere on the system if it existed, and if not then I would have to create it.

My question is, where is the best place to create this file? is just tilde slash a good place?

Is it the standard to throw in a blank file in the resources and then I can write and read to that?

You can't assume that you can write inside your app wrapper. Also, writing to ~ without permission is considered impolite.


The approved location (although I have never found this in the docs) is /Library/Application Support or ~/Library/Application Support. If you are writing to 10.4, look for NSApplicationSupportDirectory, like:

NSArray *paths = NSSearchPathForDirectoriesInDomains (NSApplicationSupportDirectory, NSAllDomainsMask, YES);

Paul


_______________________________________________ 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
References: 
 >Best Place To Save States (From: Jerrod Fowkes <email@hidden>)

  • Prev by Date: Re: added table column won't show because of autosaving
  • Next by Date: Re: Best Place To Save States
  • Previous by thread: Best Place To Save States
  • Next by thread: Re: Best Place To Save States
  • Index(es):
    • Date
    • Thread