开发者

How to get all the UITableViewCell from UITableView?

I have a list reusable UItableViewCells. As what I want: after selecting one of the cells, the app should update the images on each Cell.

For solving this requirement, I use method visibleCells to fetch all the cells from UITableView, a开发者_如何学编程nd update the images in each cell by iterating the returned cell array.

But the problem is: I can not get all the cells, method visibelCells only returns the cells currently appear on the iPhone screen.

So, any idea about how to get all the reusable cells into one array?


I think that you might be misunderstanding how the UITableView is implemented. The important point to understand is that cells that are not visible i.e don't actually exist (or at least they might not)

Accordingly, you should update the images on the visible cells and update the images on other cells as they become visible in your implementation of

-(UITableViewCell) cellForRowAtIndexPath (NSIndexPath *)indexPath
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜