[solved]: NSUserDefaults question
[solved]: NSUserDefaults question
- Subject: [solved]: NSUserDefaults question
- From: Peter Schmidt <email@hidden>
- Date: Sun, 7 Jul 2002 10:43:17 +0200
Am Samstag den, 6. Juli 2002, um 23:29, schrieb Scott Anguish:
On Thursday, July 4, 2002, at 05:35 PM, Peter Schmidt wrote:
Hello,
how can I reset my user defaults to the standard-settings?
"[NSUserDefaults resetStandardUserDefaults];" does'nt work.
You mean in the fashion of having a "default settings" button? To
do that you need to have a copy of the default settings someplace, and
then put them back into the defaults database.
usually I store the 'default settings' in an NSDictionary in the
wrapper, and then I initially register them using registerDefaults:..
then you'd need to copy the values out of of the dictionary and into
the defaults to restore the defaults
resetStandardUserDefaults does a synchronize, and then releases the
user defaults instance.
Thanks, that is a nice idea. My "default settings" button now works
perfectly!
Greets from Germany,
Peter
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.