简体   繁体   中英

NSUserDefault getting reset

I have an OSX app, where I'm using NSUserDefault to store simple value and a lot of people have started reporting to me, that the values in NSUserDefault is getting deleted randomly.

Has anyone else experienced something similar? I've searched all over SO, but I don't seem to find anyone else with the same issue.

NSUserDefaults can be vanished, when you change your BundleIdentifier ,
as the file is stored by your bundleId.

They can be found in more than one place:

~/Library/Preferences/com.example.myapp.plist
~/Library/SyncedPreferences/com.example.myapp.plist

and if sandboxed

~/Library/Containers/com.example.myapp/Data/Library/Preferences/com.example.myapp.plist
~/Library/Containers/com.example.myapp/Data/Library/SyncedPreferences/com.example.myapp.plist

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM