I just tried to use the KeychainItemWrapper provided by Apple, but I’m getting a linking error each time:
Undefined symbols for architecture i386:
“_OBJC_CLASS_$_KeychainItemWrapper”, referenced from:
objc-class-ref in DataModel.old: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I’ve included the Security framework and checked why Apple included in the Xcode project, but I can’t seem to find what else is going wrong.
_keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"com.website.project" accessGroup:nil];
[_keychain setObject:_username forKey:(id)kSecAttrAccount];
[_keychain setObject:_password forKey:(id)kSecValueData];
I also added “com.website.project” to my Keychain Access Groups.
Be sure the KeychainItemWrapper is in the “Compile Sources” list.