When the app is deleted what happens to the values stored in NSUserDefaults?

Deadly 提交于 2019-12-21 11:15:59

问题


I have a little question regarding NSUserDefaults. When the application is deleted, what happens to the values stored in the NSUserDefaults? Do they get deleted as well?

When I remove a app and reinstall it from the app store the previous NSUserDefaults values are loaded?


回答1:


When an app is deleted from the device all local data associated with the app will be deleted too. This includes NSUserDefaults. However any data stored at an online service won't. For example, iCloud. The app will just fetch the data again if requested to do so by the user / developer.

Edit

As per mAu's comment below - this includes keychain data, which won't be deleted either.



来源:https://stackoverflow.com/questions/23269625/when-the-app-is-deleted-what-happens-to-the-values-stored-in-nsuserdefaults

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!