ios swift 打印Data

代码:

    func peripheralManager(_ peripheral: CBPeripheralManager, didReceiveWrite requests: [CBATTRequest]) {
        print(#function)
        if let data: Data =  requests[0].value {
            print(data)
            print(NSData(data: data))
        }
    }

打印结果:

peripheralManager(_:didReceiveWrite:)
4 bytes
{length = 4, bytes = 0xabcd1234}

相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页