iOS Corebluetooth warning is being dealloc ' Ed while pending connection
Corebluetooth[warning] <cbperipheral:0x1780a53a0 identifier = 3f8e69bd-be87-215f-3add-64ae670bd750, Name = "Alert Notifictaion ", state = Connecting> was being dealloc ' Ed while pending connection
Use CB, to link the external Bluetooth device when the warning appears;
Solution One:
Create a strong or retain
@property (strong,nonatomic) cbperipheral *connectingperipheral;
Inside the agent that scanned the device
self. Connectingperipheral = peripheral;
storage devices;
Solution Two:
Create a mutable array to hold the published device
discoverperipherals = [[nsmutablearray alloc]init];
Inside the agent that scanned the device
//[discoverperipherals addobject:peripheral];
Scan to device will enter Method-(void) Centralmanager: (Cbcentralmanager *) Central diddiscoverperipheral: (cbperipheral *) Peripheral Advertisementdata: (nsdictionary *) advertisementdata RSSI: (NSNumber *) rssi{ NSLog (@ "11 when scanning to device:%@", Peripheral.name); [Discoverperipherals addobject:peripheral]; Self.connectingperipheral = peripheral; [Central connectperipheral:peripheral Options:nil];}
Reference: Http://stackoverflow.com/questions/15846663/ios6-cbperipheral-is-being-dealloced-while-connecting
iOS Corebluetooth warning is being dealloc ' Ed while pending connection