本文介绍了保存特定于应用程序的数据,并在删除应用程序后保留的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在应用程序卸载后保留一些数据,并且可以在应用程序再次安装后检索?
Is there a way to preserver some data even after app uninstalls and is retrievable after app gets installed again?
我找到了NSUserDefault,但我不确定。请告知。
I found NSUserDefault but I'm not sure. please advise.
let defaults = NSUserDefaults.standardUserDefaults() defaults.setObject("Coding Explorer", forKey: "userNameKey")推荐答案
您需要使用Keychain,关于应用程序的敏感信息。
You need to use Keychain, to sore sensible information regarding app.
以下是如何实现这一目标的示例。
Here is an example how to achieve that.
KeyChain示例
UserDefaults将被删除,因此替代方案是Keychain。
UserDefaults will get delete when user uninstall app from device, so the alternative is Keychain.
更多推荐
保存特定于应用程序的数据,并在删除应用程序后保留
发布评论