148 if (cell == nil) |
148 if (cell == nil) |
149 cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease]; |
149 cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease]; |
150 |
150 |
151 cell.textLabel.text = [[[self.listOfAllTeams objectAtIndex:[indexPath row]] objectForKey:@"team"] stringByDeletingPathExtension]; |
151 cell.textLabel.text = [[[self.listOfAllTeams objectAtIndex:[indexPath row]] objectForKey:@"team"] stringByDeletingPathExtension]; |
152 cell.textLabel.backgroundColor = [UIColor clearColor]; |
152 cell.textLabel.backgroundColor = [UIColor clearColor]; |
153 |
153 |
154 NSString *teamPath = [NSString stringWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),cell.textLabel.text]; |
154 NSString *teamPath = [NSString stringWithFormat:@"%@/%@.plist",TEAMS_DIRECTORY(),cell.textLabel.text]; |
155 NSDictionary *firstHog = [[[NSDictionary dictionaryWithContentsOfFile:teamPath] objectForKey:@"hedgehogs"] objectAtIndex:0]; |
155 NSDictionary *firstHog = [[[NSDictionary dictionaryWithContentsOfFile:teamPath] objectForKey:@"hedgehogs"] objectAtIndex:0]; |
156 if ([[firstHog objectForKey:@"level"] intValue] != 0) { |
156 if ([[firstHog objectForKey:@"level"] intValue] != 0) { |
157 NSString *imgString = [[NSString alloc] initWithFormat:@"%@/robotBadge.png",[[NSBundle mainBundle] resourcePath]]; |
157 NSString *imgString = [[NSString alloc] initWithFormat:@"%@/robotBadge.png",[[NSBundle mainBundle] resourcePath]]; |
158 UIImage *sprite = [[UIImage alloc] initWithContentsOfFile:imgString]; |
158 UIImage *sprite = [[UIImage alloc] initWithContentsOfFile:imgString]; |
159 [imgString release]; |
159 [imgString release]; |
160 UIImageView *spriteView = [[UIImageView alloc] initWithImage:sprite]; |
160 UIImageView *spriteView = [[UIImageView alloc] initWithImage:sprite]; |
161 [sprite release]; |
161 [sprite release]; |
162 |
162 |
163 cell.accessoryView = spriteView; |
163 cell.accessoryView = spriteView; |
164 [spriteView release]; |
164 [spriteView release]; |
165 } else |
165 } else |
166 cell.accessoryView = nil; |
166 cell.accessoryView = nil; |
167 } |
167 } |