开发者社区> 问答> 正文

iOS模拟器使用钥匙串不能写入值

OSC青岛济南源创会报名开始!>>> »

确认使用的是SecItem.h中定义的KEY, 声明如此

KeychainItemWrapper keychain = [[KeychainItemWrapper alloc] initWithIdentifier:@"MerchantAccountNumber"

                                      accessGroup:@"com.tr-gr.Merchant"]; 

[wrapper setObject:self.IDFV forKey:(__bridge id)kSecAttrDescription];

问题是:如果选用 iPhone retina(4-inch 64bit) 编译运行都OK, 但选用iPhone retina(3.5-inch) 或者 iPhone retina(4-inch) 编译通过, 运行时报错如下:

* Assertion failure in -[KeychainItemWrapper writeToKeychain], /

KeychainItemWrapper.m:354
2014-02-18 09:59:39.364 Merchant[1517:a0b] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Couldn't add the Keychain Item.'

代码都一样的, 为何选择不同的模拟器设备, 运行就出错了呢? 大家有遇到过吗?

展开
收起
杨冬芳 2016-06-29 19:01:41 2624 0
1 条回答
写回答
取消 提交回答
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
手淘iOS性能优化探索 立即下载
From Java/Android to Swift iOS 立即下载
深入剖析iOS性能优化 立即下载