Skip to content

Commit

Permalink
Cell identifier should be constant so that caching works correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
kaler authored and leah committed Jul 29, 2010
1 parent 6dd6929 commit 365af8b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Classes/DemoTableViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

NSString *CellIdentifier = [NSString stringWithFormat: @"%d:%d", [indexPath indexAtPosition: 0], [indexPath indexAtPosition: 1]];

static NSString *CellIdentifier = @"CellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
Expand Down

0 comments on commit 365af8b

Please sign in to comment.