为什么对成员 'Subscript' 的引用不明确?
Why ambiguous reference to member 'Subscript'?
这是我的Swift3代码:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
if let userInfo : Foundation.NSDictionary = launchOptions?[UIApplicationLaunchOptionsKey.remoteNotification] as? Foundation.NSDictionary {
self.setNavigationInfoFromPushNotification(userInfo: userInfo)
navigateFromPushNotification()
}
...
}
它会导致编译时错误:
Ambiguous reference to member 'Subscript'
谁能帮我解决这个问题?
方法签名已更改。参见 。
现在是:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
if let userInfo = launchOptions?[.remoteNotification] as? NSDictionary {
setNavigationInfoFromPushNotification(userInfo: userInfo)
navigateFromPushNotification()
}
...
}
这是我的Swift3代码:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
if let userInfo : Foundation.NSDictionary = launchOptions?[UIApplicationLaunchOptionsKey.remoteNotification] as? Foundation.NSDictionary {
self.setNavigationInfoFromPushNotification(userInfo: userInfo)
navigateFromPushNotification()
}
...
}
它会导致编译时错误:
Ambiguous reference to member 'Subscript'
谁能帮我解决这个问题?
方法签名已更改。参见
现在是:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
if let userInfo = launchOptions?[.remoteNotification] as? NSDictionary {
setNavigationInfoFromPushNotification(userInfo: userInfo)
navigateFromPushNotification()
}
...
}