我已经下载了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