微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

iOS蓝牙状态保存和恢复的DUPLICATE ISSUE -25299

我在实例化我的CBCentralManager时遇到了问题.从iOS控制台监控时,我收到“重复问题”消息(它没有显示在XCode控制台中).

我已经尝试更新队列名称和恢复密钥ID但没有成功.这是我实例化我的中央管理器的方式:

CBCentralManager *central = [[CBCentralManager alloc] initWithDelegate: self 
    queue: dispatch_queue_create("com.mydomain.myapp.scanner",NULL)
    options: @{
        CBCentralManagerOptionRestoreIdentifierKey: @"hexa-string-comes-here"
    }];

这些是我得到的错误

CKLs-iPhone-5S securityd[78] :
securityd_xpc_dictionary_handler MyApp[2571] add The operation
Couldn’t be completed. (Osstatus error -25299 – duplicate item
O,genp,E99372E2,L,ck,X2W6M5UYJ9.com.mydomain.myapp,acct,svce,v_Data,20151218165347.298588Z,2CAE5650)

CKLs-iPhone-5S MyApp[2571] : SecOsstatusWith
error:[-25299] The operation Couldn’t be completed. (Osstatus error
-25299 РRemote error : The operation Couldn’t be completed. (Osstatus error -25299 Рduplicate item
O,2CAE5650))

有任何想法吗?

解决方法

如果你想使用 CBCentralManagerOptionRestoreIdentifierKey,你必须

>实施方法

// in Objective-C
- (void)centralManager:(CBCentralManager *)central willRestoreState:(NSDictionary<Nsstring *,id> *)dict

// or in Swift
func centralManager(_ central: CBCentralManager,willRestoreState dict: [String : AnyObject])

CBCentralManagerDelegate起,和
>使用背景模式使用Xcode中设置的蓝牙LE配件:

原文地址:https://www.jb51.cc/iOS/333943.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐