The status of CBCentralManagerStatePoweredOn not only means that Bluetooth is turned on, but your instance of CBCentralManager or CBPeripheralManager is ready to use. You must initialize your manager, and then wait until its state changes before using it. For example, if you act as Central, you should initialize it as follows:
centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil];
And we implement the centralManagerDidUpdateState: delegate centralManagerDidUpdateState:
- (void)centralManagerDidUpdateState:(CBCentralManager *)central { if (central.state == CBCentralManagerPoweredOn) {
source share