NSUserDefaults synchronization in Foundation tools
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