I am trying to save login information as follows
+(void) saveLoginInfo:(NSString *) userId password:(NSString *)password {
KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:@"userLogin" accessGroup:nil];
[keychainItem setObject:@"myApp" forKey: (__bridge id)kSecAttrService];
[keychainItem setObject:password forKey:(__bridge id) kSecValueData];
[keychainItem setObject:userId forKey:(__bridge id) kSecAttrAccount];
}
But I get the error
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Couldn't update the Keychain Item.'
Any ideas how I can fix this?