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

标签 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 的可选绑定(bind)时遇到错误, 谁能帮我这个?

最佳答案

swift 3.0

试试这个。

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

关于ios - Swift 中对成员下标错误的不明确引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45646814/

相关文章:

ios - 在不使用全局变量的情况下在多个 swift 类中重用大型未更改数组

ios - 将按钮绑定(bind)到 View iOS swift 的右上角

ios - 如何仅在第一次打开应用程序时显示图像?

Swift Package Manager 可执行应用程序,设置部署目标

bluetooth-lowenergy - 使用定位应用程序进行 Radius Networks 信标校准

ios - 根据精度计算 2D 信标位置

android - eclipse 错误 "Could not found android-beacon-library.apk"

ios - NSMutableArray UIButton 按下历史记录

ios - Swift - CoreData 故障

ios - 有没有办法快速拦截标准输出?