project_files/HedgewarsMobile/Classes/SingleTeamViewController.m
changeset 3662 a44406f4369b
parent 3660 bc125bea5849
child 3697 d5b30d6373fc
--- a/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m	Tue Jul 20 23:30:54 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/SingleTeamViewController.m	Thu Jul 22 03:08:17 2010 +0200
@@ -295,10 +295,9 @@
                 break;
         }
         
-        nextController.title = [secondaryItems objectAtIndex:row];
-        [nextController setTeamDictionary:teamDictionary];
+        if ([nextController respondsToSelector:@selector(setTeamDictionary:)])
+            [nextController setTeamDictionary:teamDictionary];
         [self.navigationController pushViewController:nextController animated:YES];
-        [nextController release];
     } else {
         EditableCellView *cell = (EditableCellView *)[aTableView cellForRowAtIndexPath:indexPath];
         [cell replyKeyboard];
@@ -309,9 +308,8 @@
 
 // action to perform when you want to change a hog hat
 -(void) tableView:(UITableView *)aTableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {
-    if (nil == hogHatViewController) {
+    if (nil == hogHatViewController)
         hogHatViewController = [[HogHatViewController alloc] initWithStyle:UITableViewStyleGrouped];
-    }
     
     // cache the dictionary file of the team, so that other controllers can modify it
     hogHatViewController.teamDictionary = self.teamDictionary;
@@ -345,17 +343,19 @@
 }
 
 -(void) viewDidUnload {
+    [super viewDidUnload];
     self.teamDictionary = nil;
     self.teamName = nil;
     self.normalHogSprite = nil;
     self.secondaryItems = nil;
     hogHatViewController = nil;
+    gravesViewController = nil;
+    voicesViewController = nil;
     flagsViewController = nil;
     fortsViewController = nil;
-    gravesViewController = nil;
     levelViewController = nil;
+    MSG_DIDUNLOAD();
     [super viewDidUnload];
-    MSG_DIDUNLOAD();
 }
 
 -(void) dealloc {
@@ -364,8 +364,9 @@
     [normalHogSprite release];
     [secondaryItems release];
     [hogHatViewController release];
+    [gravesViewController release];
     [fortsViewController release];
-    [gravesViewController release];
+    [voicesViewController release];
     [flagsViewController release];
     [levelViewController release];
     [super dealloc];