Swift 从UITableViewController切换到另一个问题
我正在尝试对UI表类型的2个ViewController进行分段,但它显示了一个错误“Thread 1:signal SIGABRT”,代码如下:Swift 从UITableViewController切换到另一个问题,swift,xcode,uitableview,segue,sigabrt,Swift,Xcode,Uitableview,Segue,Sigabrt,我正在尝试对UI表类型的2个ViewController进行分段,但它显示了一个错误“Thread 1:signal SIGABRT”,代码如下: override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "showPlates"{ if let indexPath = self.tableView.indexPathForSelectedRow{
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "showPlates"{
if let indexPath = self.tableView.indexPathForSelectedRow{
let selectedRecipe = self.recetas[indexPath.row]
let destinationViewController = segue.destination as! PlateViewController
destinationViewController.recetas = [selectedRecipe]
}
}
}
可能您还没有在故事板(我猜是在Main.storyboard中)中为所需的目标ViewController设置类(PlateViewController)
如果您不将
用作代码>什么类型的对象是destinationViewController
?这是否回答了您的问题?我简直不敢相信我:facepalm:,没错,非常感谢