On Sep 8, 2009, at 4:24 PM, Jens Alfke wrote:
On Sep 8, 2009, at 4:13 PM, Sidney San Martín wrote:
"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)"

To my knowledge that's always been incorrect — the only time NSUserDefaults synchronizes automatically is upon quit. The app can change a default, stay running for days, then crash; and the default won't have been written to disk so the change is lost. So I've always ended up calling -synchronize myself, either immediately or using a perform-after-delay.

Automatic synchronization of changes to NSUserDefaults was added in Leopard. CFPreferences may behave differently.


--
Greg Parker     gpar...@apple.com     Runtime Wrangler


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to