Re: Problem with UITableView
Re: Problem with UITableView
- Subject: Re: Problem with UITableView
- From: David Duncan <email@hidden>
- Date: Sat, 31 Jul 2010 22:34:20 -0700
On Jul 31, 2010, at 10:25 PM, Laurent Daudelin wrote:
> Isn't the purpose of dequeueReusableCellWithIdentifier: of reusing tableview's objects? I've used this in the past and it never failed me. The documentation says "For performance reasons, a table view'€™s data source should generally reuse UITableViewCell objects when it assigns cells to rows in its tableView:cellForRowAtIndexPath: method". So, that's what I'm using. Of course, I have 2 different cells for the 2 sections and I can't understand why it doesn't work. Right now, I have 4 cells in section 2 but in the future, I might have dozens of cells representing dozens of entries. I cannot possibly create a different cell for each row, can I?
I think you misunderstand what cell reuse is in UIKit. Each row must be an individual instance of some cell type, but as you scroll through a table you might go through dozens or hundreds of rows that all share a specific type. In such a case you might have less than a dozen cell instances for those hundreds of rows, but you still need individual instances for each row.
--
David Duncan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden