Permalink
Browse files

No need to set the label's text twice.

  • Loading branch information...
1 parent 0118df1 commit 9921afd06a1680868991995f13c1d89386877782 @snej snej committed Sep 15, 2011
Showing with 5 additions and 8 deletions.
  1. +5 −8 Source/RootViewController.m
@@ -130,16 +130,13 @@ - (void)couchTableSource:(CouchUITableSource*)source
cell.textLabel.backgroundColor = [UIColor clearColor];
// Configure the cell contents. Our view function (see above) copies the document properties
- // into its value, so we can read them from there without having to load the document:
+ // into its value, so we can read them from there without having to load the document.
+ // cell.textLabel.text is already set, thanks to setting up labelProperty above.
NSDictionary* properties = row.value;
BOOL checked = [[properties objectForKey:@"check"] boolValue];
-
- UILabel *labelWithText = cell.textLabel;
- labelWithText.text = [properties objectForKey:@"text"];
- labelWithText.textColor = checked ? [UIColor grayColor] : [UIColor blackColor];
-
- [cell.imageView setImage:[UIImage imageNamed:
- (checked ? @"list_area___checkbox___checked" : @"list_area___checkbox___unchecked")]];
+ cell.textLabel.textColor = checked ? [UIColor grayColor] : [UIColor blackColor];
+ cell.imageView.image = [UIImage imageNamed:
+ (checked ? @"list_area___checkbox___checked" : @"list_area___checkbox___unchecked")];
}

0 comments on commit 9921afd

Please sign in to comment.