I am using the KeychainItemWrapper to store my logged in users email and password. With the following code:
KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:@"loginData" accessGroup:nil];
[keychainItem setObject:@"myString" forKey: (id)kSecAttrService];
[keychainItem setObject:email forKey:(id)kSecAttrAccount];
[keychainItem setObject:password forKey:(id)kSecValueData];
I get the following error:
*** Assertion failure in -[KeychainItemWrapper writeToKeychain],
If I change this line:
[keychainItem setObject:email forKey:(id)kSecAttrAccount];
To this:
[keychainItem setObject:@"whatever" forKey:(id)kSecAttrAccount];
It works. So it seems that I can't set an email to the Keychain. What should I do?