我正在尝试搜索具有特定服务 UUID 的外围设备,我输入了如下代码行,但它弹出错误,我是不是漏掉了什么?有人可以建议吗。
centralManager.scanForPeripheralsWithServices([NSArray arrayWithObject [CBUUID UUIDWithString:@ "180A"]], options: nil)
最佳答案
我从你提供的信息中了解到的似乎是语法错误。
试试这段代码..
让 serviceUUIDs:[AnyObject] = [CBUUID(string: "180D")] centralManager.scanForPeripheralsWithServices(serviceUUIDs, options: nil)
关于ios - CoreBluetooth 扫描特定服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33473145/