Re: NSUserDefaults not sticking
Re: NSUserDefaults not sticking
- Subject: Re: NSUserDefaults not sticking
- From: Kyle Sluder <email@hidden>
- Date: Wed, 10 Sep 2014 19:28:27 -0700
On Sep 10, 2014, at 7:04 PM, Scott Ribe <email@hidden> wrote:
>
> The real point: plenty of sites on the web state that the .plist no longer represents the current state, but that the defaults command will read the current state so you can use it for debugging. They are wrong. Apparently there's something about the caching such that defaults, and I expect any other process outside the one making the changes, DOES NOT return the latest values you synched. It is absolutely the case that your app can use NSUserDefaults to update defaults, can synch them, can then read back the new values and confirm that NSUserDefaults is returning the latest values you gave it, and the defaults command line will at that point still be returning stale values from before your update.
It’s my understanding that this shouldn’t happen. If you can reproduce it, you should file a Radar.
Also, you should almost never need to call -synchronize yourself. The framework does it at appropriate times.
--Kyle Sluder
_______________________________________________
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