UITableView cellForRowAtIndexPath called more than once for each row

前端 未结 3 588
青春惊慌失措
青春惊慌失措 2021-01-18 05:54

If I have a UITableView that has 4 rows in it then shouldn\'t the cellForRowAtIndexPath method be called 4 times when I navigate to that view? I am finding that it is being

3条回答
  •  我在风中等你
    2021-01-18 06:41

    The method is called when the cell appears, so whenever a cell appears, the method is called. Also, the cells are reused. So even if the method for a particular cell is called once, it maybe called for another time when this cell disappears and then appears again.

提交回复
热议问题