Swift中对成员下标错误的模糊引用

时间:2017-08-12 05:24:20

标签: ios swift beacon

var centralManager: CBCentralManager!

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

我在执行CentralManagerIdentifiers的可选绑定时收到错误, 谁能帮我这个?

1 个答案:

答案 0 :(得分:0)

Swift 3.0

试试这个。

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