Core Bluetooth CBCentralManager always reports state as Unknown on Mac
<p>I'm new to Swift and Mac/iOs programming in general. I'm running this sample on a Macbook Pro with BLE support and with Bluetooth turned on, using Xcode 7.3.</p>

<pre><code>import Foundation
import CoreBluetooth

func printState(state: CBCentralManagerState) {
    switch state {
    case CBCentralManagerState.PoweredOn:
        print("Powered on")
    case CBCentralManagerState.PoweredOff:
        print("Powered off")
    case CBCentralManagerState.Resetting:
        print("Resetting")
    case CBCentralManagerState.Unauthorized:
        print("Unauthorized")
    case CBCentralManagerState.Unknown:
        print("Unknown")
    default:
        print ("Unsupported")
    }

}

var myCentralManager = CBCentralManager(delegate:nil, queue:nil)
while true {
    printState(myCentralManager.state)
    sleep(1)
}
</code></pre>

<p>The code prints out "Unknown" over and over, even after many minutes. I've also tried setting up a delegate but the didUpdateState callback doesn't called. I've also tried to run this from the command line and Swift interpreter and get the same result.</p>

<p>I must be missing something very basic. How can I get it to report that the CBCentralManager is powered on?</p>