Skip to content

Commit

Permalink
Moved the content array to the class
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Kompanez authored and Tim Davies committed Jul 24, 2010
1 parent 8db918c commit 2b1a3ad
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions TDBadgedCell (xcode project)/Classes/RootViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import "TDBadgedCell.h"

@interface RootViewController : UITableViewController {
NSArray *contents;
}

@end
8 changes: 4 additions & 4 deletions TDBadgedCell (xcode project)/Classes/RootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

@implementation RootViewController

NSArray *contents;

- (void)viewDidLoad {
[super viewDidLoad];

Expand Down Expand Up @@ -88,10 +86,10 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.badgeNumber = [[[contents objectAtIndex:indexPath.row] objectForKey:@"badge"] intValue];

if(indexPath.row == 1)
if (indexPath.row == 1)
cell.badgeColor = [UIColor colorWithRed:1.000 green:0.397 blue:0.419 alpha:1.000];

if(indexPath.row == 2)
if (indexPath.row == 2)
cell.badgeColor = [UIColor colorWithWhite:0.783 alpha:1.000];

return cell;
Expand All @@ -104,6 +102,8 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath


- (void)dealloc {
[contents release];

[super dealloc];
}

Expand Down

0 comments on commit 2b1a3ad

Please sign in to comment.