0

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?

Zia
  • 14,622
  • 7
  • 40
  • 59
  • Isn’t `identifier` supposed to be your app’s identifier? I could be way off-base here, but it seems odd. – Zev Eisenberg Apr 30 '14 at 21:23
  • I have the same problem as in that question but the causes are different. Also, that answer does not work for me. – Zia May 01 '14 at 00:23

0 Answers0