问题
In my app I am saving service urls and their user/passwords in a plist in the documents directory currently. I want to move the user and passwords over to keychain and protect the plist files aswell. I tried using the keychainwrapper class given in this example, but couldn't figure out how to add items to it.
how do i add an array of dictionaries containing user name and passwords into keychain, and protect my plist files aswell?
回答1:
If you want to use keychain, best solution is using third party library(STKeychain). It is very simple to use it.
If you want to store array to keychain, what you can do is you can convert array to serialised string and store that string to one keychain. Or you can store dictionaries to several keychain if you like.
I don't understand why you still want to protect your plist? Keychain is enough, don't need to store it to plist anymore!
来源:https://stackoverflow.com/questions/13420432/protecting-plist-in-ipad-app