33 NSString *normalHogFile = [[NSString alloc] initWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()]; |
33 NSString *normalHogFile = [[NSString alloc] initWithFormat:@"%@/Hedgehog.png",GRAPHICS_DIRECTORY()]; |
34 UIImage *hogSprite = [[UIImage alloc] initWithContentsOfFile:normalHogFile andCutAt:CGRectMake(96, 0, 32, 32)]; |
34 UIImage *hogSprite = [[UIImage alloc] initWithContentsOfFile:normalHogFile andCutAt:CGRectMake(96, 0, 32, 32)]; |
35 [normalHogFile release]; |
35 [normalHogFile release]; |
36 self.normalHogSprite = hogSprite; |
36 self.normalHogSprite = hogSprite; |
37 [hogSprite release]; |
37 [hogSprite release]; |
|
38 |
|
39 self.title = NSLocalizedString(@"Change hedgehog's hat",@""); |
38 } |
40 } |
39 |
41 |
40 - (void)viewWillAppear:(BOOL)animated { |
42 - (void)viewWillAppear:(BOOL)animated { |
41 [super viewWillAppear:animated]; |
43 [super viewWillAppear:animated]; |
42 self.title = [[[teamDictionary objectForKey:@"hedgehogs"] objectAtIndex:selectedHog] objectForKey:@"hogname"]; |
44 |
43 |
|
44 // this updates the hog name and its hat |
45 // this updates the hog name and its hat |
45 [self.tableView reloadData]; |
46 [self.tableView reloadData]; |
46 // this moves the tableview to the top |
47 // this moves the tableview to the top |
47 [self.tableView setContentOffset:CGPointMake(0,0) animated:NO]; |
48 [self.tableView setContentOffset:CGPointMake(0,0) animated:NO]; |
48 } |
49 } |
130 - (void)viewDidUnload { |
131 - (void)viewDidUnload { |
131 self.lastIndexPath = nil; |
132 self.lastIndexPath = nil; |
132 self.normalHogSprite = nil; |
133 self.normalHogSprite = nil; |
133 self.teamDictionary = nil; |
134 self.teamDictionary = nil; |
134 self.hatArray = nil; |
135 self.hatArray = nil; |
|
136 MSG_DIDUNLOAD(); |
135 [super viewDidUnload]; |
137 [super viewDidUnload]; |
136 MSG_DIDUNLOAD(); |
|
137 } |
138 } |
138 |
139 |
139 - (void)dealloc { |
140 - (void)dealloc { |
140 [hatArray release]; |
141 [hatArray release]; |
141 [teamDictionary release]; |
142 [teamDictionary release]; |