我正在尝试这个
Using the Keychain to store passwords on iOS故事来存储用户的电子邮件和密码进行登录.
在我的m文件中:
.... .... #import "KeychainItemWrapper.m" .... .... KeychainItemWrapper* keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"KeychainTest" accessGroup:nil]; [keychain setobject:kSecAttrAccessibleWhenUnlocked forKey:kSecAttrAccessible]; NSLog(@"%@,%@",[keychain objectForKey:kSecAttrAccount],[keychain objectForKey:kSecValueData]); [keychain setobject:@"example@email.com" forKey:kSecAttrAccount]; [keychain setobject:@"MySuperSecretPassword" forKey:kSecValueData]; NSLog(@"%@,[keychain objectForKey:kSecValueData]);
但我收到以下错误:
Implicit conversion of C pointer type 'CFTypeRef' (aka 'const void *') to Objective-C pointer type 'id' requires a bridged cast