4-digit Password Setup
What is the best (and quickest) way to setup a simple 4-diget password in my app?
It needs to be editable by the user. And it needs to be savable on 开发者_运维知识库the device itself.
Is a NSUserDefaults a safe place to store the password?
You want to add anything to do with password into the user KeyChain on the device- Keychain Services
iOS will take of decrypting and encrypting the information for you. And when the user sync and or replace his device, the Keychain will be on his new device.
A password of any kind is considered a sensitive information and you (as a developer) should handle it properly.
The proper way to store password is to use the Keychain.
I wouldn't store any kind of password in the NSUserDefaults
Is there a reason you insisted on using NSUserDefaults
instead of the keychain?
I would suggest the spinning wheel control with 4 spinners, each having digits 0-9
精彩评论