Re: Several different NSUserDefaults in the same app?

2021-04-06 Thread Martin Wierschin via Cocoa-dev
This topic of default defaults (aka initial, hardcoded, or fallback values) came up recently on this developer blog: https://mjtsai.com/blog/2021/04/02/foil-userdefaults-property-wrapper/ I've always used this same

Re: Several different NSUserDefaults in the same app?

2021-04-06 Thread Jack Brindle via Cocoa-dev
I agree with you, to an extent. NSUserDefaults is very good when used as a single-level repository for settings data. When you want to categorize the settings by using collections, it starts to show the same problems that a regular file has, except slightly worse. Collections are saved as an

Re: Several different NSUserDefaults in the same app?

2021-04-06 Thread Gabriel Zachmann via Cocoa-dev
> We don?t use NSUserDefaults in the app. Instead we have an > NSMutableDictionary that holds the settings, and we write them to a file when > they change. We read them in at app startup. > That allows us to actually have different settings for various items Yes, that certainly works. There