开发者

iPhone UITableView - Visible Cells

开发者 https://www.devze.com 2022-12-28 10:44 出处:网络
I have a grouped UITableView, with cells in section 2 depending on cells in section 1. More precisely, each cell in section 1 is associated with multiple cells of section two and deleting a row in sec

I have a grouped UITableView, with cells in section 2 depending on cells in section 1. More precisely, each cell in section 1 is associated with multiple cells of section two and deleting a row in section 1 needs to delete the associated rows in section 2.

I have my dataSources all set up and everything works fine if all cells are visible. However, if the cells from section 2 haven't been loaded in the UITableView yet, I have a problem because the data source is updated for section 2 too.

I'm looking at this method visibleCells in UITableView. But I'm using custom UITableView cells and get an unrecog开发者_如何学Cnized selector exception if I try to access one of the labels in a cell.

How do I get around this?

Thanks,

Teja.


I believe what you were looking for is:

if ([tableView visibleCells] containsObject: theCellOfInterest]) {
    // Do whatever you want to do.
}


Sorry if I wasn't clear the first time (or maybe even the second time too), but here's an answer to a repost of the same question.

Deleting multiple (not yet loaded) rows in UITableView

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号