6

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.

Popeye
  • 11,356
  • 9
  • 56
  • 88

2 Answers2

12

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.

Abizern
  • 138,728
  • 38
  • 201
  • 254
4

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.

SiHa
  • 6,756
  • 12
  • 30
  • 41
Ankit Srivastava
  • 12,237
  • 11
  • 61
  • 115