jjzjj

didFailToConnectPeripheral

全部标签

iOS 8 : When App in Background CBCentralManager Delegate Method didDiscoverPeripheral, didConnectPeripheral、didFailToConnectPeripheral 未调用

我在iOS8中使用Xcode6。当应用程序在后台运行时,我正在尝试搜索和连接蓝牙设备。我正在使用核心蓝牙框架。我使用Xcode功能选项添加了蓝牙中心和蓝牙外围设备。代码:Appdelegate.h@interfaceWSAppDelegate:UIResponder@property(strong,nonatomic)NSString*savedUUID;@property(strong,nonatomic)CBCentralManager*CBCM;AppDelegate.m-(void)applicationDidEnterBackground:(UIApplication*)ap

iOS 核心蓝牙 : centralManager:didConnectPeripheral/didFailToConnectPeripheral: not getting called

我正在努力解决这个问题。我正在尝试连接到BLE设备,但在下面的代码中看不到我做错了什么。-(void)viewDidLoad{[superviewDidLoad];//Doanyadditionalsetupafterloadingtheview,typicallyfromanib._cm=[[CBCentralManageralloc]initWithDelegate:selfqueue:nil];}-(void)viewDidAppear:(BOOL)animated{[superviewDidAppear:animated];}-(void)didReceiveMemoryWar