When fetching the data:
KeychainItemWrapper *keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"LoginData" accessGroup:nil];
NSString *user = [[NSUserDefaults standardUserDefaults] valueForKey:@"ACC"];
NSString *pass = [keychain objectForKey:CFBridgingRelease(kSecAttrAccount)];
When saving the data:
KeychainItemWrapper *keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"LoginData" accessGroup:nil];
[[NSUserDefaults standardUserDefaults] setObject:[jsonResult objectForKey:@"user"] forKey:@"ACC"];
[keychain setObject:[jsonResult objectForKey:@"token"] forKey:CFBridgingRelease(kSecAttrAccount)];
I'm re-using code i've used a couple years ago. However now i'm experiancing issues with part of it not working correctly.
For what it's worth, i'm using the KeyChainItemWrapper Version: 1.2 ( Objective-c )
The [[NSUserDefaults standardUserDefaults] valueForKey:@"ACC"]
works fine, and is saved, however storing a value for CFBridgingRelease(kSecAttrAccount)
doesn't save. When running the fetch code, after the save code, i only get (null)
.
I'm using xcode 8.3.1 with simulator version 10, running iPhone 7 version 10.3.
The newest IDE version & iOS version is the only thing that has changed