Why do I get CBCentralManagerStateUnknown
on an iPad 2 when using this simple code?
- (BOOL)viewDidLoad {
bluetoothManager = [[CBCentralManager
You need to both retain the CBCentralManager
instance (put it in an ivar or private property) and wait for the state change delegate to be called. (The state is always "unknown" if you check it immediately after instantiating the manager. The real state will appear momentarily in the delegate method.)