cellForRowAtIndexPath获取的 Cell 为空

在 tableview 中进行多选删除操作,当我选择顶部两行,能够得到选中的row分别为0和1,当我把顶部两行滚出屏幕之外时,依然能够得到选中的row分别为0和1,但是ChatTableViewCell *cell = (ChatTableViewCell *)[self.tableView cellForRowAtIndexPath:indexPath];
得到的 Cell 为空。

求大神解答是何问题?

阅读 7.5k
1 个回答
[tableView registerClass:[ChatTableViewCell class] forCellReuseIdentifier:identifier];

ChatTableViewCell *cell = (ChatTableViewCell *)[self tableView:tableView cellForRowAtIndexPath:indexPath];
宣传栏