Is data stored in NSUserDefaults persists through application updates and on application reinstallation (remove-install)?

别等时光非礼了梦想. 提交于 2019-12-21 10:57:05

问题


It's important to my app, becuase I want to store app UDID there, and Apple recommends to create app specific UDID starting from iOS 5.0.


回答1:


User defaults are persisted through updates but are not persisted through deleting and re-installing the app. At present, the keychain is persisted through deleting and re-installing the app, but it's not documented to be one way or the other, so relying on this behavior may be risky.

You could also write the value to the iCloud key/value store. That will be persisted across all installations of the app for that user and is kind of what it was designed for.




回答2:


Generally no. In some cases however, especially if a user is installing a cracked version of your app, then yes, some user defaults may stay, due to the way that many users install cracked applications, which creates backups of the documents / library folders on uninstall.



来源:https://stackoverflow.com/questions/9163798/is-data-stored-in-nsuserdefaults-persists-through-application-updates-and-on-app

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