问题
I am developing an application in iOS where I want to provide a password option..where user can enter a password and set it,and later when he opens the app,it should first ask for password to enter,
So can we implement this?
Any ideas ,suggestions are welcomed.....
Regards Ranjit
回答1:
Maybe save the password in the NSUserDefaults and request that password if one is set...
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSUserDefaults_Class/Reference/Reference.html
回答2:
Save the password to the keychain. Don't store it anywhere else, if you care about security. You could use SFHFKeychainUtils to do this easily.
来源:https://stackoverflow.com/questions/8255395/how-to-set-a-password-for-application-in-ios