Skip to content

Commit

Permalink
UITableView now uses UITableCell queueing
Browse files Browse the repository at this point in the history
This commit adds queue utilization to the UITableView to improve the
performance of table cell rendering. Instead of always
creating/destroying UITableCell's, UITableCell's are reused out of a
queue.
  • Loading branch information
timnovinger committed Apr 6, 2011
1 parent 30c3f08 commit a0ce0e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion MNAlertDashboardViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,12 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
MNTableViewCell *cell = [[[MNTableViewCell alloc] init] autorelease];
MNTableViewCell *cell = (MNTableViewCell *) [tableView dequeueReusableCellWithIdentifier:@"notificationTableCell"];

if (cell == nil)
{
cell = [[[MNTableViewCell alloc] init] autorelease];
}

MNAlertData *dataObj = [[_delegate getPendingAlerts] objectAtIndex:indexPath.row];

Expand Down
2 changes: 1 addition & 1 deletion MNTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ @implementation MNTableViewCell

-(id)init
{
self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"notificationTableCell"];
if(self != nil)
{
CGRect aframe = self.frame;
Expand Down

0 comments on commit a0ce0e7

Please sign in to comment.