Instance Method

centralManagerDidUpdateState:

Tells the delegate the central manager’s state updated.

Required.

Declaration

- (void)centralManagerDidUpdateState:(CBCentralManager *)central;

Parameters

central

The central manager whose state has changed.

Discussion

You implement this required method to ensure that the central device supports Bluetooth low energy and that it’s available to use. You should issue commands to the central manager only when the central manager’s state indicates it’s powered on. A state with a value lower than CBCentralManagerStatePoweredOn implies that scanning has stopped, which in turn disconnects any previously-connected peripherals. If the state moves below CBCentralManagerStatePoweredOff, all CBPeripheral objects obtained from this central manager become invalid; you must retrieve or discover these peripherals again. For a complete list of possible states, see the CBCentralManagerState enumeration in CBCentralManager.

See Also

Monitoring the Central Manager’s State

- centralManager:willRestoreState:

Tells the delegate the system is about to restore the central manager, as part of relaunching the app into the background.