Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.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
通过restorationIdentifier/获取单元格UITableView,而不使用indexpath[swift]_Swift_Uitableview_Cell_Indexpath - Fatal编程技术网

通过restorationIdentifier/获取单元格UITableView,而不使用indexpath[swift]

通过restorationIdentifier/获取单元格UITableView,而不使用indexpath[swift],swift,uitableview,cell,indexpath,Swift,Uitableview,Cell,Indexpath,如何在没有indexpath的情况下转到单元格以更改内容 这是有道理的: let cell = tableView.cellForRow(at: indexPath) 但是,每个细胞都有一个恢复标识符。 我可以使用restorationIdentifier更改单元格的内容吗?方法是更新模型,然后调用tableView.reloadData()。Koen,我需要在不重新加载表格的情况下更新一个特定单元格。我将使用:tableView.beginUpdates()tableView.endUpda

如何在没有indexpath的情况下转到单元格以更改内容

这是有道理的:

let cell = tableView.cellForRow(at: indexPath)
但是,每个细胞都有一个恢复标识符。
我可以使用restorationIdentifier更改单元格的内容吗?

方法是更新模型,然后调用
tableView.reloadData()
。Koen,我需要在不重新加载表格的情况下更新一个特定单元格。我将使用:
tableView.beginUpdates()tableView.endUpdates()
,但我不需要使用“indexpath”调用此单元格,而是使用“restorationIdentifier”重复使用单元格,因此您为标识单元格而添加的任何标记或id都可能丢失。