ios8 - iOS8 的 KeychainItemWrapper 崩溃

标签 ios8 keychainitemwrapper

我正在使用 KeychainItemWrapper对于我的应用程序,使用以下代码行

KeychainItemWrapper *currentUser = [[KeychainItemWrapper alloc] initWithIdentifier:@"com.example" accessGroup:nil];
[currentUser setObject:accountString forKey:CFBridgingRelease(kSecAttrAccount)];

accountString 是一个包含我的用户信息的字符串。

该代码在 iOS7 上运行良好,但在 iOS8 上崩溃。

我不确定我做错了什么。有人可以帮忙!我在模拟器上运行应用程序。

更新:
这是崩溃

* -[KeychainItemWrapper writeToKeychain] 中的断言失败

* 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“无法添加钥匙串(keychain)项。”

最佳答案

看起来第一个 BETA 版本不支持模拟器上的 Keychain Access 开发人员 API。希望这很快就会被引入。

更新:看起来问题已在 Beta 2 中修复

关于ios8 - iOS8 的 KeychainItemWrapper 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24073320/

相关文章:

swift - 如何在 swift 中声明一个闭包的局部变量

ios - 在 KeyChainItemWrapper 中保存密码时崩溃

ios - 无法添加钥匙串(keychain)项目。使用 KeychainItemWrapper 更改标识符后出现错误 - 25299?

iOS:如何获取安装引荐来源

ios - [UIImageAsset 保留] : message sent to deallocated instance

ios - 我怎样才能制作表情符号或输入任何内容

ios - 在 Swift 中调用 webAPI & fatal error : dictionary literal contains duplicate keys

ios - 一次获取钥匙串(keychain)中的所有项目?

swift - 尝试将 Apple "translated"的 KeychainItemWrapper 用于 Swift