Using keychain to store username and password in xcode 4

白昼怎懂夜的黑 提交于 2019-12-03 11:15:20

问题


I don't want to use NSUserDefaults as I have been told it's not a good way to save a username and password.

So I was going to use a Keychain, but I have never used them before. Can some one please just a give a quick example of one or point me in the direction of an example ? Thanks.


回答1:


I Use the open source SSKeychain wrapper around the the C api used by the keychain.

It's convenient, easy to use, and works on Mac OS and iOS.




回答2:


This is the best I have found till date... It five a very simple implementation of saving passwords and username to keychain. Please remember to include security framework in your project.

https://web.archive.org/web/20160305031351/http://iosdevelopertips.com/core-services/using-keychain-to-store-username-and-password.html

Keep in mind that this doen't work on simulator.



来源:https://stackoverflow.com/questions/8572517/using-keychain-to-store-username-and-password-in-xcode-4

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