• 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
[solved]: NSUserDefaults question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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.

References: 
 >Re: NSUserDefaults question (From: Scott Anguish <email@hidden>)

  • Prev by Date: Missing characters
  • Next by Date: Re: Missing characters
  • Previous by thread: Re: NSUserDefaults question
  • Next by thread: PB not letting me build modified code in MenuExtras!!
  • Index(es):
    • Date
    • Thread