我是编码新手。在 Swift 1.2 更新之前创建 segue 没有任何问题。Cannot assign a value of type 'PFObject' to a value of type 'PFObject?'
当我尝试下面的代码时,我收到了错误。谁能帮我解决这个问题?
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "PushToDetails" {
// Get the new view controller using [segue destinationViewController].
var detailScene = segue.destinationViewController as! DetailViewController
// Pass the selected object to the destination view controller.
if let indexPath = self.tableView.indexPathForSelectedRow() {
let row = Int(indexPath.row)
detailScene.currentObject = objects[row] as! PFObject
}
}
}