Gabriel; It appears you are trying to get NSUserDefaults to do something that Apple doesn’t want it to do these days. Why not create your own defaults, writing the data to a dictionary that is then written to a file that you save in the ~/Library/Preferences folder, with a name of your choice?
This does work in Big Sur, we use it ourselves. The down side is that you don’t have the nice (and infuriating) caching of defaults that the system provides. Note that the system will still create the standard user defaults file for you, to save things like window positioning. But, you can save these things yourself in your own files. Just make sure you don’t use the same file name as the system uses, or it will overwrite yours. You can modify it as you suggested previously, though. Jack > On Apr 3, 2021, at 11:26 AM, Richard Charles via Cocoa-dev > <cocoa-dev@lists.apple.com> wrote: > > >> On Apr 3, 2021, at 9:56 AM, Gabriel Zachmann <z...@cs.uni-bremen.de> wrote: >> >> Sorry for asking: the shared instance is the one that is persistent, right? > > > Looks like an instance created from alloc init would not be useful in your > situation. It appears you would be in charge of persistence. > > NSUserDefault , Alloc init vs standard Userdefault > > https://stackoverflow.com/questions/36615260 > > --Richard Charles > > _______________________________________________ > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/jackbrindle%40me.com > > This email sent to jackbrin...@me.com _______________________________________________ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com