What are the exact circumstances in which I can reuse a cell (using dequeueReusableCellWithIdentifier
in the UITableView class)?
Asked
Active
Viewed 122 times
1

Casebash
- 114,675
- 90
- 247
- 350
1 Answers
1
That a cell is available for reuse with the identifier you pass in. Your only requirement is to use the same identifier for the same type of cell you want.
Just remember, if one wasn't available for reuse, you need to create one.

jer
- 20,094
- 5
- 45
- 69
-
What exactly does "same type of cell" mean? – Casebash Sep 27 '10 at 00:07
-
If you have to ask that, you probably only have one type of cell. By "same type of cell" I mean, for instance, if you a cell which has a label on the left and a text field on the right, and another cell which contains just a button. That (could be) two different types of cells, which should have different reuse identifiers. Typically you do this when you have different elements in the cell. – jer Sep 27 '10 at 00:21
-
What if the only difference is that the cell size is different? Can I reuse the cell (resizing it of course)? If so, will this offer any performance benefit? – Casebash Sep 27 '10 at 00:37
-
Height doesn't matter in terms of cell reuse, since the cells are sized when they're displayed automatically based on your tableview delegate. – jer Sep 27 '10 at 01:20