gpt4 book ai didi

objective-c - 不可能在钥匙串(keychain)中存储电子邮件 (KeychainItemWrapper)

转载 作者:IT王子 更新时间:2023-10-29 08:10:37 27 4
gpt4 key购买 nike

我正在使用 KeychainItemWrapper 的 ARCified 版本,可在 github 获得,而且我无法让它同时存储电子邮件和密码。

KeychainItemWrapper *keychainItem = [[KeychainItemWrapper alloc] initWithIdentifier:@"myApp" accessGroup:@"MY_APP.com.yourcompany.GenericKeychainSuite"];
[keychainItem setObject:[self.email dataUsingEncoding:NSUTF8StringEncoding] forKey:(__bridge id)kSecAttrAccount];
[keychainItem setObject:self.password forKey:(__bridge id)kSecValueData];

只要我存储一封没有@符号的电子邮件,我就可以完美地工作。否则,我得到错误

*** Assertion failure in -[KeychainItemWrapper writeToKeychain]
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Couldn't add the Keychain Item.'

来自那些行

result = SecItemAdd((__bridge CFDictionaryRef)[self dictionaryToSecItemFormat:keychainItemData], NULL);
NSAssert( result == noErr, @"Couldn't add the Keychain Item." );

您知道这里可能出什么问题吗?

谢谢

最佳答案

好吧,我只是按照该页面上的建议找到了答案 iOS KeychainItemWrapper not updating , 也就是添加

[keychainWrapper setObject:@"Myappstring" forKey: (id)kSecAttrService];

关于objective-c - 不可能在钥匙串(keychain)中存储电子邮件 (KeychainItemWrapper),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9886064/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com