Re: What's the easiest way to save users preferences
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)...