Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 从UITableViewController切换到另一个问题_Swift_Xcode_Uitableview_Segue_Sigabrt - Fatal编程技术网

Swift 从UITableViewController切换到另一个问题

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{

我正在尝试对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{

            let selectedRecipe = self.recetas[indexPath.row]
            let destinationViewController = segue.destination as! PlateViewController


            destinationViewController.recetas = [selectedRecipe]

        }

    }
}

可能您还没有在故事板(我猜是在Main.storyboard中)中为所需的目标ViewController设置类(PlateViewController)


如果您不将
用作什么类型的对象是
destinationViewController
?这是否回答了您的问题?我简直不敢相信我:facepalm:,没错,非常感谢