1
我在swift 2.2中正常工作,但是當我轉換爲swift 3.0時會出錯。UIApplicationLaunch通過remoteNotification swift 3不能正常工作
//If app open by notification
if launchOptions != nil
{
NSLog("launch------ %@", launchOptions!)
let userInfo = launchOptions!(UIApplicationLaunchOptionsKey.remoteNotification) as NSDictionary
if userInfo != nil
{
self.application(UIApplication.shared, didReceiveRemoteNotification: (userInfo)! as! [NSObject : AnyObject])
}
}
錯誤等
無法調用非功能型的值 '[NSObject的:任何]'
預先感謝。
我做的時候我用這個得到一個錯誤,你使用的是什麼Xcode版本?我正在使用8測試版3,並且似乎給出了一個錯誤:對成員'下標'的歧義引用 – TheeBen
您可以在這裏向我展示代碼。 –