Re: Confusion with app settings / NSUserDefaults
Re: Confusion with app settings / NSUserDefaults
- Subject: Re: Confusion with app settings / NSUserDefaults
- From: Saagar Jha via Cocoa-dev <email@hidden>
- Date: Wed, 16 Aug 2023 01:22:57 -0700
Yes, although in practice I’ve seen the preferences make it to disk fairly
quickly after app termination.
Saagar Jha
> On Aug 15, 2023, at 13:36, Gabriel Zachmann <email@hidden> wrote:
>
> Ah, thanks a lot for the insights!
>
> Could it happen that the new settings have not been written to disk even if
> the app has quit normally?
> Or, in other words, there might be key/value pairs stored in cfprefsd's
> internal/runtime storage, even if i have changed the app and those key/value
> pairs do no loner correspond to any of the app's settings?
>
> Best regards, Gabriel
>
>
>
>> On 6. Aug 2023, at 12:57, Saagar Jha <email@hidden> wrote:
>>
>> The plist file on disk is written to sporadically. cfprefsd is generally the
>> arbiter what the real values are, and it may or may not write things to disk
>> immediately. Conversely, it’s not necessarily sitting around watching the
>> plist file for changes. The correct way to update user defaults in an ad-hoc
>> fashion is to use the defaults command.
>>
>
_______________________________________________
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