iPad: Iterate over every cell in a UITableView?

后端 未结 7 1900
眼角桃花
眼角桃花 2020-12-08 19:37

iPad: Iterate over every cell in a UITableView?

7条回答
  •  自闭症患者
    2020-12-08 19:59

    To iterate over every visible cell in a UITableView:

    for (UITableViewCell *cell in self.tableView.visibleCells) {
        NSIndexPath *cellIndexPath = [self.tableView indexPathForCell:cell];
    

    (edited to better state answer and hope that this is indexed more accurately for search results with the intention of saving others more time in the future)

提交回复
热议问题