iOS:如何在应用程序中存储用户名/密码? - iOS: How to store username/password within an app?

问题:

I have a login-screen in my iOS app.我的 iOS 应用中有一个登录屏幕。 The username and password will be saved in the NSUserDefaults and be loaded into the login-screen again when you enter the app again (of course, NSUserDefaults are permanent).用户名和密码将保存在NSUserDefaults并在您再次进入应用程序时再次加载到登录屏幕(当然, NSUserDefaults是永久的)。

Now, the user have the possibility to disable the username/password saving feature.现在,用户可以禁用用户名/密码保存功能。

So the NSUserDefaults will be cleared then.所以NSUserDefaults将被清除。

But In my app I need this username/password for database queries for the user.但是在我的应用程序中,我需要这个用户名/密码来为用户查询数据库。 So: Where to store the data except NSUserDefaults ?那么:除了NSUserDefaults之外,在哪里存储数据? (This place can / should be deleted when the user quit the app or logout). (当用户退出应用程序或注销时,这个地方可以/应该被删除)。


解决方案:

参考一: https://en.stackoom.com/question/TFl6
参考二: https://stackoom.com/question/TFl6
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章