我已經下載了ParseStarterProject版本1.14.3和下載後,要求我先轉換爲迅速3.之後給我一個錯誤:解析入門套件的斯威夫特3
Cannot convert value of type '(Bool, NSError?) ->()' to expected argument type 'PFBooleanResultBlock?'
代碼:
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let installation = PFInstallation.current()
installation?.setDeviceTokenFrom(deviceToken)
installation?.saveInBackground()
PFPush.subscribeToChannel(inBackground: "") { (succeeded: Bool, error: NSError?) in
if succeeded {
print("ParseStarterProject successfully subscribed to push notifications on the broadcast channel.\n")
} else {
print("ParseStarterProject failed to subscribe to push notifications on the broadcast channel with error = %@.\n", error)
}
} as! PFBooleanResultBlock as! PFBooleanResultBlock as! PFBooleanResultBlock as! PFBooleanResultBlock as! PFBooleanResultBlock as! PFBooleanResultBlock as! PFBooleanResultBlock
}
解決,但給我這個錯誤:
"Expected) in the expression list"
是作爲7列表! PFBooleanResultBlock'是一個錯字?你爲什麼選擇這種類型? – nathan
這是Xcode自動轉換爲swift 3 ...但即使沒有這個錯字它不起作用。 –
看起來你的確切問題已經在這裏解決:http://stackoverflow.com/a/39684760/6658553 – nathan