Is it harmful to comment out the code that reuses the cell in a UITableView?
// if (cell == nil)
// {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
// }
Thanks.
EDIT: Based on the reply of @jrturton, I decided not to do that.
It will increase memory use and affect scrolling performance. If you’ve only got 10 cells, it probably doesn’t make any difference. With 1,000, it will be very noticeable.
You will also need to comment out the dequeue call to the tableView.
I have to ask, though – why are you concerned about this? There may be a better solution to your problem.
Based on your comment, you might still want to reuse a cell per row – otherwise when something is scrolled off screen and returned, you would have to recreate it. You can incorporate the indexPath row and section into the cell reuse string to facilitate this: