IOS Couldn & #39; t update the Keychain Item
Generally, it is safer to store accounts and passwords using Keychain, which is roughly as follows:
KeychainItemWrapper * keychain = [[KeychainItemWrapper alloc] initWithIdentifier: @ "MyLogin" accessGroup: nil]; [keychain setObject: self. phoneText. text forKey :( _ bridge id) (kSecAttrAccount)]; [keychain setObject: self. keyText. text forKey :( _ bridge id) (kSecValueData)];
But occasionally, a problem occurs, that is, the Couldn doesn't update the Keychain Item, and then the application will crash.
I checked it and added a line of code. It seems that the problem has been solved and whether it will continue to appear later. The principle is not very clear.
KeychainItemWrapper * keychain = [[KeychainItemWrapper alloc] initWithIdentifier: @ "MyLogin" accessGroup: nil]; [keychain setObject: self. phoneText. text forKey :( _ bridge id) (kSecAttrAccount)]; [keychain setObject: self. keyText. text forKey :( _ bridge id) (kSecValueData)]; [keychain setObject: @ "AppString" forKey: (_ bridge id) kSecAttrService];
I feel that I have added an identifier to the app. I hope you can explain it to me.