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
tableview.cellforrow(在indexpath处)在ios swift的DIDSelectRow中返回nil_Ios_Swift_Uitableview_Tableview - Fatal编程技术网

tableview.cellforrow(在indexpath处)在ios swift的DIDSelectRow中返回nil

tableview.cellforrow(在indexpath处)在ios swift的DIDSelectRow中返回nil,ios,swift,uitableview,tableview,Ios,Swift,Uitableview,Tableview,我试图找到选定的单元格。在中选择rowat功能。但是cellForRowAt返回nil值 override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { guard let _ = self.tableView.cellForRow(at: indexPath) as? ChatListTableViewCell else { return } } 请

我试图找到选定的单元格。在
中选择rowat
功能。但是
cellForRowAt
返回nil值

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    guard let _ = self.tableView.cellForRow(at: indexPath) as? ChatListTableViewCell else {
        return }
   }

请显示
cellforrowatinex
方法的代码使用
UITableView
indexPathForSelectedRow
方法。是否验证
cellForRow
函数是否真的返回nil?guard let可能也会失败,因为找到的单元格无法强制转换为
ChatListTableViewCell
。请显示
cellForRowAtIndex
methodUse
UITableView
indexPathForSelectedRow
方法的代码。是否验证
cellForRow
函数是否真的返回零?guard let可能也会失败,因为找到的单元格无法转换为
ChatListTableViewCell