问题描述
我正在努力更新,并对其默认配置进行微小更改。自从我最后一次构建它以来已经有一段时间了,所以我已经将Xcode升级到4.2并在最新版本中包含了iOS 5支持。
I'm working on updating an iPhone application with a minor change in its default configuration. It's been awhile since I've built it last, though, and so I've upgraded Xcode to 4.2 and included iOS 5 support in the latest builds.
当我走的时候要在设备上测试,我得到以下断言错误:
When I go to test on the device, I get the following assertion error:
2011-11-02 20:57:18.869 RoseBandwidth[903:707] Tried to add item, got result: -25243
2011-11-02 20:57:18.870 RoseBandwidth[903:707] *** Assertion failure in -[KeychainItemWrapper writeToKeychain], /Users/tim/code/RoseBandwidth/Classes/KeychainItemWrapper.m:312
2011-11-02 20:57:18.872 RoseBandwidth[903:707] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Couldn't add the Keychain Item.'
我正在使用 KeychainItemWrapper的实现来自Apple的
课程。值得注意的是,此错误仅出现在设备上,而不是出现在模拟器中(我知道平台之间的访问组限制差异,但通常我认为这会导致模拟器出现问题,而不是真正的硬件)。
I'm using the implementation of the KeychainItemWrapper
class from Apple's GenericKeychain project. It's worth noting that this error only shows up on the device, not in the Simulator (and I'm aware of the access group restriction differences between platforms, but usually I thought that caused problems on the Simulator, not actual hardware).
为什么我会收到此错误?我没有触及与应用程序的钥匙串相关部分相关的任何内容;它完全按照以前的方式存储和检索数据。
Why would I be getting this error back? I've touched nothing relevant to the keychain-related parts of the app; it stores and retrieves data exactly like it used to.
推荐答案
好的,我无法完成您的项目构建,但是来自我认为你可能想检查您的权利文件。至少在github项目中,您没有在Keychain Access Groups中指定任何内容。
Okay, I couldn't quite get your project to build, but from How to share keychain data between iOS applications I think you might want to check your entitlements file. At least in the github project you didn't have anything specified in the Keychain Access Groups.
这篇关于iOS Keychain SecItemAdd返回-25243的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!