• 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
User Defaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

User Defaults


  • Subject: User Defaults
  • From: Roland Silver <email@hidden>
  • Date: Mon, 30 Apr 2007 20:22:05 -0600

My program has two menu items, call them "File..." and "File Again" (Please leave aside the question of why I'm not using Open... and Open Recent).
If the user chooses the former, he gets a window/panel allowing him
to select the file the app works on. If he chooses the latter, the
app works on the last file he selected.
So, in the former case, I save the file path string in
[NSUserDefaults standardUserDefaults], with key @"inFilePath", say.
In the latter case, I retrieve the file path string in
[NSUserDefaults standardUserDefaults].


So the set of user defaults must persist between one invocation of
the app to another, presumably stored in some file, somewhere. That
file doesn't appear to be the project's Info.plist, because there's
no occurrence of the string "inFilePath" there.

So where is it stashed? And do I have to do something to stash it
(and retrieve it when my app begins execution), or does that happen
automatically?

Although reading "User Defaults Programming Topics" should enlighten
me, I'm unable to form a mental picture of what's going on from
reading it.

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: User Defaults
      • From: Fred Baker <email@hidden>
  • Prev by Date: Re: Byte swapping using NSInputStream
  • Next by Date: Core Data fetch request crashes the app
  • Previous by thread: Cocoaheads Lake Forest (92630) meeting Tomorrow, Tuesday 5/1
  • Next by thread: Re: User Defaults
  • Index(es):
    • Date
    • Thread