多个CBCentralManager实例?

时间:2015-05-18 17:26:09

标签: ios bluetooth core-bluetooth

是否支持多个CBCentralManager个实例?如果是这样,他们开始支持哪个版本的iOS?

我在Apple邮件列表上找到了multiple emails,说明它们不是。但是,这不是通过例外或具有理论+sharedCentralManager来强制执行的。有人说文档说它们不受支持。但是,在the documentation中不再提及,并且当前头文件注释(iOS 8.3 SDK)是:

/*!
 *  @class CBCentralManager
 *
 *  @discussion Entry point to the central role. Commands should only be issued when its state is <code>CBCentralManagerStatePoweredOn</code>.
 *
 */

我不希望CBPeripheral个实例在CBCentralManager个实例之间移植(这不是这个问题的关键),我只希望有多个&#34;窗户&#34;进入蓝牙堆栈(没有任何不正常的行为)。

1 个答案:

答案 0 :(得分:4)

从iOS 8.3开始,创建第二个CBCentralManager实例似乎会导致第二个实例将其状态报告为CBCentralManagerStateUnsupported2)。因此,不支持CBCentralManager的多个实例。