【问题标题】:How to NSLog() a periphal?如何 NSLog() 外围设备?
【发布时间】:2012-11-18 04:24:50
【问题描述】:

我无法识别通常会导致我能够正确使用 NSLog() 的外围设备。

- (void)centralManager:(CBCentralManager *)central didRetrievePeripherals:(NSArray *)peripherals {
  NSLog(@"discovered peripherals: %@", howToListPeriphalsForDebugging);
}

谢谢

【问题讨论】:

  • 您在NSLog上面遇到的问题是什么?如果我是正确的CBPeripheral 是一个指针,您可以将它与%@ 一起使用。
  • 我正在研究更多。其实我现在还没到那里……
  • 你试过了吗:NSLog(@"discovered peripherals: %@", peripherals);?看起来该数组是CBPeripheral 对象的数组。
  • OK,已修复,现在可以测试了。你可以 NSLog() 它。
  • 你也可以,NSLog(@"%@",[peripherals description]);

标签: ios ios6 bluetooth-lowenergy cbperipheral cbcentralmanager


【解决方案1】:

尝试改变:

NSLog(@"discovered peripherals: %@", howToListPeriphalsForDebugging);

收件人:

NSLog(@"discovered peripherals: %@", peripherals);

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-09-27
    • 1970-01-01
    • 1970-01-01
    • 2014-12-25
    • 1970-01-01
    • 1970-01-01
    • 2021-06-08
    相关资源
    最近更新 更多