gpt4 book ai didi

ios - 多点连接崩溃尝试从对象 [2] 插入零对象

转载 作者:可可西里 更新时间:2023-11-01 06:15:30 24 4
gpt4 key购买 nike

在我的应用程序中,我使用多对等连接通过蓝牙发送文件。我发现了一个非常奇怪的情况,它使应用程序崩溃并始终出现相同的错误:

1) 两个设备连接2)两者之一断开并进入后台3) 其他用户邀请这个点加入一个 session ,这个设备上的应用程序崩溃了

为了不遇到崩溃,有必要重新加载 NSNearbybrowser 并重新开始浏览。但是当设备进入后台时,不会立即调用丢失的方法,因此无法知道何时重新加载。有人问过类似的问题,但我从来没有在任何软件中看到过这个错误:

enter image description here

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[2]'

是我的错还是苹果的错?如果是我该怎么办?

最佳答案

您可能有兴趣阅读 this doc来自 Apple(“声明您的应用程序支持的后台任务”部分)关于即使在后台模式下也能保持蓝牙通信事件的方法。

Support for some types of background execution must be declared in advance by the app that uses them. In Xcode 5 and later, you declare the background modes your app supports from the Capabilities tab of your project settings. Enabling the Background Modes option adds the UIBackgroundModes key to your app’s Info.plist file.

关于ios - 多点连接崩溃尝试从对象 [2] 插入零对象,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19747936/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com