I have used CoreBluetooth framework to scan for all services and get the peripheral it works well when i launch my application first time, but if i popover to previous class and come again from that class , my delegate methods of CBCentralManger is not getting triggered
But the below method is called in the second time
-(void)centralManagerDidUpdateState:(CBCentralManager *)central {
if (central.state != CBCentralManagerStatePoweredOn) {
UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"BLE not supported !" message:[NSString stringWithFormat:@"CoreBluetooth return state: %ld",central.state] delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
}
else {
[central scanForPeripheralsWithServices:nil options:nil];
}
}
but after this its not getting triggered the rest of the delegate methods
-(void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI {
}
-(void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral {
}
- (void)centralManager:(CBCentralManager *)central didFailToConnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error
{
}
can any one tell me what would be the possibilities for not calling these delegate methods?