• 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: What's the easiest way to save users preferences
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's the easiest way to save users preferences


  • Subject: Re: What's the easiest way to save users preferences
  • From: Allan Odgaard <email@hidden>
  • Date: Sat, 2 Feb 2002 17:22:05 +0100

On lxrdag, februar 2, 2002, at 05:03 , Taxxodium wrote:

Can somebody tell me how to write and read the prefs?

Have a look at NSUserDefaults. You obtain the preference object like this:

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

This has normal NSDictionary syntax, i.e. you setXYZ:forKey or retrieve it likewise. The dictionary is automatically saved to disk when your program exits (and also at regular time intervals AFAIK)...


  • Follow-Ups:
    • Re: What's the easiest way to save users preferences
      • From: Cyril Godefroy <email@hidden>
References: 
 >What's the easiest way to save users preferences (From: Taxxodium <email@hidden>)

  • Prev by Date: Re: What's the easiest way to save users preferences
  • Next by Date: Objective-C++ or C bridge?
  • Previous by thread: Re: What's the easiest way to save users preferences
  • Next by thread: Re: What's the easiest way to save users preferences
  • Index(es):
    • Date
    • Thread