• 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: Problem with NSUserDefaultsController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with NSUserDefaultsController


  • Subject: Re: Problem with NSUserDefaultsController
  • From: Keary Suska <email@hidden>
  • Date: Sun, 31 Aug 2008 10:25:38 -0600
  • Thread-topic: Problem with NSUserDefaultsController

8/31/08 10:13 AM, also sprach email@hidden:

> I've been playing around with bindings to NSUserDefaultsController in
> a very simple app to test saving preferences, but the
> [sharedUserDefaultsController save:self] method seems to return
> immediately without waiting for the save operation to complete.
>
> The save does actually take place, which I can see if I open the
> plist file in Property List Editor, but if the very next line after
> sending the save message is one which reads a property from the
> plist, it's the old value which gets returned rather than the newly
> saved one.

The -save: method is unintuitive in name. It does not, as you may think,
save changes to disk. It simply commits any changes to the NSUserDefaults
object. It's a no-op if appliesImmediately is YES. The only way to force a
save is to call -synchronize on NSUserDefaults.

Best,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

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

  • Follow-Ups:
    • Re: Problem with NSUserDefaultsController
      • From: Mark Allan <email@hidden>
References: 
 >Problem with NSUserDefaultsController (From: Mark Allan <email@hidden>)

  • Prev by Date: Problem with NSUserDefaultsController
  • Next by Date: Re: Subclassing NSCoder
  • Previous by thread: Problem with NSUserDefaultsController
  • Next by thread: Re: Problem with NSUserDefaultsController
  • Index(es):
    • Date
    • Thread