ios Keychain KeychainItemWrapper

 炙天痕_953 发布于 2022-11-01 22:27

部分真机报Couldn't add the Keychain Item.
源码:
KeychainItemWrapper *wrapper = [[KeychainItemWrapper alloc] initWithIdentifier:@"UserId" accessGroup:nil];
[wrapper setObject:[NSString stringWithFormat: @"%ld", (long)user_id] forKey: (__bridge_transfer id)(kSecValueData)];

Couldn't add the Keychain Item.
(null)
(
0 CoreFoundation 0x0000000182ee42f4 + 160
1 libobjc.A.dylib 0x00000001946b80e4 objc_exception_throw + 60
2 CoreFoundation 0x0000000182ee4198 + 0
3 Foundation 0x0000000183d98ed4 + 112
4 ziyou 0x10007ea38 -[KeychainItemWrapper writeToKeychain] + 732
5 ziyou 0x10007e0c4 -[KeychainItemWrapper setObject:forKey:] + 200
6 ziyou 0x10002dc9c +[Utility setKeyChainUserId:] + 248
7 ziyou 0x10007bc74 __29-[AppDelegate registerUserId]_block_invoke + 648
8 ziyou 0x1000389c4 __64-[UserApi registerUser:andInstallationId:andCheckCode:andblock:]_block_invoke + 264
9 ziyou 0x1000cd1e4 __64-[AFHTTPRequestOperation setCompletionBlockWithSuccess:failure:]_block_invoke46 + 56
10 libdispatch.dylib 0x0000000194d09994 + 24
11 libdispatch.dylib 0x0000000194d09954 + 16
12 libdispatch.dylib 0x0000000194d0e20c _dispatch_main_queue_callback_4CF + 1608
13 CoreFoundation 0x0000000182e9b7f8 + 12
14 CoreFoundation 0x0000000182e998a0 + 1492
15 CoreFoundation 0x0000000182dc52d4 CFRunLoopRunSpecific + 396
16 GraphicsServices 0x000000018c5e36fc GSEventRunModal + 168
17 UIKit 0x000000018798afac UIApplicationMain + 1488
18 ziyou 0x10002ece8 main + 124
19 libdyld.dylib 0x0000000194d36a08 + 4
)

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有