• 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
Proper way to revert with NSUserDefaultsController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Proper way to revert with NSUserDefaultsController


  • Subject: Proper way to revert with NSUserDefaultsController
  • From: "Lorenzo Thurman" <email@hidden>
  • Date: Mon, 21 Apr 2008 09:08:35 -0500

I've run into some trouble using revert with NSUserDefaultsController:
It doesn't work. My settings do not revert to their previous settings. I'm
working on a prefs window and what I want to have happen is if a user clicks
the cancel button, any changes made are reverted to their previous setting.
I have programmatically set [[NSUserdefaultsController
sharedUserDefaultsController] setAppliesImmediately:NO]. My understanding
was that this was required for revert to work. I found a post at
cocoabuilder that said using this pair of messages would work to revert
settings:

dictionaryWithValuesForKeys (to get the current state of the user prefs)
setValuesForKeysWithDictionary (to restore the user prefs)

This actually works for me and I'm OK with this as a solution, but I'd still
like to know how revert should work. There are a number of posts about
revert at cocoabuilder. Many people seem to have issues with it, so it's use
does not appear to be as straightforward as implied by the docs.
Thanks


--
"My break-dancing days are over, but there's always the funky chicken"
--The Full Monty
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

  • Prev by Date: Re: Binding NSButton enabled state
  • Next by Date: Premature notification from NSApplication - workaround?
  • Previous by thread: Selection in NSCollectionView
  • Next by thread: Premature notification from NSApplication - workaround?
  • Index(es):
    • Date
    • Thread