小编Cla*_*vis的帖子

为什么使用coreBluetooth connectPeripheral没有在IOS8中调用委托方法

我想在IOS8中使用CoreBluetooth.framework来实现数据传输,我确实在以下方法中发现了外设并尝试连接外设.

- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
{
    NSLog(@"Discover name : %@", peripheral.name);
    [self.centralManager connectPeripheral:peripheral options:nil];
}
Run Code Online (Sandbox Code Playgroud)

但它没有调用委托方法didFailToConnectPeripheraldidConnectPeripheral ,我对它有什么问题,是代码错误还是IOS8需要一些额外的东西?怎么处理,谢谢!

这是我在github中的代码,我写了一个程序作为服务器,另一个是中央.

objective-c ios core-bluetooth ios8

11
推荐指数
2
解决办法
6616
查看次数

标签 统计

core-bluetooth ×1

ios ×1

ios8 ×1

objective-c ×1