Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.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 UITableViewRowAction在模拟器中工作,但在设备上不工作?_Swift_Uitableview_Ios Simulator_Uitableviewrowaction - Fatal编程技术网

Swift UITableViewRowAction在模拟器中工作,但在设备上不工作?

Swift UITableViewRowAction在模拟器中工作,但在设备上不工作?,swift,uitableview,ios-simulator,uitableviewrowaction,Swift,Uitableview,Ios Simulator,Uitableviewrowaction,我在单元格上有一个带有UITableViewRowAction的表视图,因此我可以滑动单元格以显示操作。它可以在模拟器上完美地工作,但在设备上不能。你知道为什么吗 var deleteButton = UITableViewRowAction(style: .Default, title: "delete", handler: { (action, indexPath) in self.foodTableView.dataSource?.tableView?(

我在单元格上有一个带有
UITableViewRowAction
的表视图,因此我可以滑动单元格以显示操作。它可以在模拟器上完美地工作,但在设备上不能。你知道为什么吗

var deleteButton = UITableViewRowAction(style: .Default, title: "delete", handler: { (action, indexPath) in
            self.foodTableView.dataSource?.tableView?(
                self.foodTableView,
                commitEditingStyle: .Delete,
                forRowAtIndexPath: indexPath

            )

        return [deleteButton]
    }