我想制作一个ios应用程序,使用蓝牙进行通信。我用的是斯威夫特。
因此,首先我添加CoreBluetooth.framework,然后添加一个桥接.h并将文件添加到系统桥中,导入“Core蓝牙/CoreBlue.h”。
然后我创建了一个新的类
import UIKit
class BTCentral: NSObject, CBCentralManagerDelegate {
}我计划在那个类中创建一个蓝牙CBCentralManager。但是,上面的代码给了我一个错误。
Type 'BTCentral' does not conform to protocol 'CBCentralManagerDelegate' 下面是一个特定的ScreenShot:click here
任何帮助都将不胜感激!非常感谢你们抽出时间。
发布于 2014-06-16 14:37:33
您必须实现协议所需的所有方法。在这种情况下,CBCentralManagerDelegate只需要实现一个方法,即centralManagerDidUpdateState()。
将此方法添加到类中,错误将消失。
func centralManagerDidUpdateState(central: CBCentralManager!) {
}https://stackoverflow.com/questions/24246088
复制相似问题