【发布时间】:2016-09-12 23:25:18
【问题描述】:
在下载 Xcode 8 之前,我能够毫无问题地从 Particle iOS Cloud SDK (Spark SDK) 执行功能。现在,我收到了多个错误,都类似于下面的错误。
SparkCloud.sharedInstance().loginWithUser(username!, password: password!) { (error:NSError?) -> Void in
// Deactivates activity indicator.
activityIndicator.stopAnimating()
// Reallows interaction events.
UIApplication.sharedApplication().endIgnoringInteractionEvents()
if error != nil {
Utils.showAlertOnVC(self, title: "Invalid parameters.", message: "Please try again.")
self.clearText()
} else {
self.performSegueWithIdentifier("loginUser", sender: self)
}
}
错误:无法将类型“(NSError?)-> Void”的值转换为预期的参数类型“SparkCompletionBlock?”
SparkCloud.sharedInstance().getDevices { (sparkDevices: [AnyObject]?, error: NSError?) -> Void in
if let sparkDevices = sparkDevices as? [SparkDevice] {
for device in sparkDevices {
self.myPhotons.append(device)
self.tableView.reloadData()
}
}
}
错误:无法将类型 '([AnyObject]?, NSError?) -> Void' 的值转换为预期的参数类型 '(([Any]?, Error?) -> Void)?'
我尝试更新我的 Podfile 并玩弄函数调用,但似乎没有任何效果。我想知道它是否与 Swift 3.0 中的更新有关,但我找不到任何表明这一点的东西。对此问题的任何帮助将不胜感激。
【问题讨论】:
标签: ios cloud swift3 xcode8 particles