0
「下標」
我是從2版本遷移我的雨燕代碼3.在我的AppDelegate.swift我已經正在實施以下方法:曖昧參考成員的AppDelegate
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]?) -> Bool {
FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)
// error below this line
if let notification = launchOptions?[UIApplicationLaunchOptionsKey.remoteNotification] as? [NSObject : AnyObject] {
} else {}
return true
}
,我發現了以下錯誤:
Ambiguous reference to member 'subscript'
我該如何解決這個問題?
通常是因爲你做了'東西[somethingelse]',但你沒有指定編譯器'something'可以使用'[]'(下標)。另外,你的方法不是Swift 3:請在這裏檢查:https://developer.apple.com/reference/uikit/uiapplicationdelegate/1622921-application「Swift3 compliant one」。 – Larme