对 Swift 中成员下标错误的不明确引用


var centralManager: CBCentralManager!
@nonobjc func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
**if let centralManagerIdentifiers = launchOptions?[UIApplicationLaunchOptionsBluetoothCentralsKey]** {
NSLog("UIApplicationLaunchOptionsBluetoothCentralsKey = (centralManagerIdentifiers)")
}

我在执行中央管理器标识符的可选绑定时收到错误, 谁能帮我解决这个问题?

Swift 3.0

试试这个。

if let centralManagerIdentifiers = launchOptions?[UIApplicationLaunchOptionsKey.bluetoothCentrals] {
NSLog("UIApplicationLaunchOptionsBluetoothCentralsKey = (centralManagerIdentifiers)")
}

最新更新