• 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
NSUserDefaults synchronization in Foundation tools
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSUserDefaults synchronization in Foundation tools


  • Subject: NSUserDefaults synchronization in Foundation tools
  • From: Sidney San Martín <email@hidden>
  • Date: Tue, 8 Sep 2009 19:13:50 -0400

The docs for NSUserDefaults have this to say regarding - [NSUserDefaults synchronize]:

"Because this method is automatically invoked at periodic intervals, use this method only if you cannot wait for the automatic synchronization (for example, if your application is about to exit)"

NSUserDefaults seems to be hooked into -[NSApplication terminate:], since I can store a value and immediately terminate the application and the value is stored to disk. NSUserDefaults does not have the same behavior when used with a Foundation tool, since there's no Foundation- provided runloop and indeed no Foundation-provided way to exit your application.

Will NSUserDefaults ever synchronize itself itself in an app without an NSApplication? If so, when and how? If not, the docs need to be ammended.
_______________________________________________


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: NSUserDefaults synchronization in Foundation tools
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Framework versioning and handling multiple OS SDK's?
  • Next by Date: Re: NSUserDefaults synchronization in Foundation tools
  • Previous by thread: scaleUnitSquareToSize strange behavior Scaling a UI
  • Next by thread: Re: NSUserDefaults synchronization in Foundation tools
  • Index(es):
    • Date
    • Thread