project_files/HedgewarsMobile/Classes/MasterViewController.m
author koda
Sun, 29 Aug 2010 16:55:27 +0200
changeset 3783 8e9daf967406
parent 3737 2ba6ac8a114b
child 3829 81db3c85784b
permissions -rw-r--r--
X&Y buttons, sounds for some buttons, cleanup
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     1
//
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     2
//  MasterViewController.m
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     3
//  HedgewarsMobile
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     4
//
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     5
//  Created by Vittorio on 27/03/10.
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     6
//  Copyright 2010 __MyCompanyName__. All rights reserved.
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     7
//
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     8
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
     9
#import "MasterViewController.h"
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    10
#import "GeneralSettingsViewController.h"
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    11
#import "TeamSettingsViewController.h"
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    12
#import "WeaponSettingsViewController.h"
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    13
#import "SchemeSettingsViewController.h"
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    14
#import "CommodityFunctions.h"
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    15
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    16
@implementation MasterViewController
3701
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    17
@synthesize targetController, controllerNames, lastIndexPath;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    18
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    19
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    20
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    21
    return rotationManager(interfaceOrientation);
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    22
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    23
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    24
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    25
#pragma mark -
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    26
#pragma mark View lifecycle
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    27
-(void) viewDidLoad {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    28
    [super viewDidLoad];
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
    29
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    30
    // the list of selectable controllers
3701
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    31
    NSArray *array = [[NSArray alloc] initWithObjects:NSLocalizedString(@"General",@""),
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    32
                                                      NSLocalizedString(@"Teams",@""),
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    33
                                                      NSLocalizedString(@"Weapons",@""),
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    34
                                                      NSLocalizedString(@"Schemes",@""),
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    35
                                                      nil];
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    36
    self.controllerNames = array;
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    37
    [array release];
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    38
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    39
    // targetControllers tells whether we're on the right or left side of the splitview -- on iphone we only use the right side
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    40
    if (targetController == nil && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    41
        if (nil == generalSettingsViewController)
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    42
            generalSettingsViewController = [[GeneralSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    43
        generalSettingsViewController.navigationItem.hidesBackButton = YES;
3737
2ba6ac8a114b reworked the initialization functions, now it should be safe to update and no more need of spinning wheel at first launch
koda
parents: 3701
diff changeset
    44
        [generalSettingsViewController viewWillAppear:YES];
3701
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    45
        [self.navigationController pushViewController:generalSettingsViewController animated:NO];
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    46
    } else {
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    47
        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    48
                                                                                              target:self
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    49
                                                                                              action:@selector(dismissSplitView)];
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    50
    }
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    51
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    52
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    53
#pragma mark -
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    54
#pragma mark Table view data source
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    55
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    56
    return 1;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    57
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    58
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    59
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    60
    return [controllerNames count];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    61
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    62
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    63
// Customize the appearance of table view cells.
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    64
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    65
    static NSString *CellIdentifier = @"Cell";
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
    66
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    67
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
3783
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    68
    if (cell == nil)
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    69
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
3783
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    70
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    71
    NSString *iconStr = nil;
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    72
    switch ([indexPath row]) {
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    73
        case 0:
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    74
            iconStr = [NSString stringWithFormat:@"%@/TargetBee.png",GRAPHICS_DIRECTORY()];
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    75
            break;
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    76
        case 1:
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    77
            iconStr = [NSString stringWithFormat:@"%@/Egg.png",GRAPHICS_DIRECTORY()];
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    78
            break;
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    79
        case 2:
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    80
            iconStr = [NSString stringWithFormat:@"%@/Molotov.png",GRAPHICS_DIRECTORY()];
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    81
            break;
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    82
        case 3:
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    83
            iconStr = [NSString stringWithFormat:@"%@/Target.png",GRAPHICS_DIRECTORY()];
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    84
            break;
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    85
        default:
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    86
            //seduction.png for support page
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    87
            DLog(@"Nope");
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    88
            break;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
    89
    }
3783
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    90
    
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    91
    if (nil == targetController)
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    92
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    93
    else
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    94
        cell.accessoryType = UITableViewCellAccessoryNone;
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
    95
3701
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
    96
    cell.textLabel.text = [controllerNames objectAtIndex:[indexPath row]];
3783
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    97
    UIImage *icon = [[UIImage alloc] initWithContentsOfFile:iconStr];
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    98
    cell.imageView.image = icon;
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
    99
    [icon release];
3701
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
   100
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   101
    return cell;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   102
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   103
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   104
#pragma mark -
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   105
#pragma mark Table view delegate
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   106
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   107
    int newRow = [indexPath row];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   108
    int oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   109
    UIViewController *nextController = nil;
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
   110
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   111
    if (newRow != oldRow) {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   112
        [self.tableView deselectRowAtIndexPath:lastIndexPath animated:YES];
3701
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
   113
        [targetController.navigationController popToRootViewControllerAnimated:NO];
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
   114
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   115
        switch (newRow) {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   116
            case 0:
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   117
                if (nil == generalSettingsViewController)
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   118
                    generalSettingsViewController = [[GeneralSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   119
                nextController = generalSettingsViewController;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   120
                break;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   121
            case 1:
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   122
                if (nil == teamSettingsViewController)
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   123
                    teamSettingsViewController = [[TeamSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   124
                nextController = teamSettingsViewController;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   125
                break;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   126
            case 2:
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   127
                if (nil == weaponSettingsViewController)
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   128
                    weaponSettingsViewController = [[WeaponSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   129
                nextController = weaponSettingsViewController;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   130
                break;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   131
            case 3:
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   132
                if (nil == schemeSettingsViewController)
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   133
                    schemeSettingsViewController = [[SchemeSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   134
                nextController = schemeSettingsViewController;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   135
                break;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   136
        }
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
   137
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   138
        nextController.title = [controllerNames objectAtIndex:newRow];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   139
        self.lastIndexPath = indexPath;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   140
        [self.tableView selectRowAtIndexPath:indexPath animated:YES scrollPosition:UITableViewScrollPositionNone];
3701
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
   141
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
   142
        if (nil == targetController) {
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
   143
            nextController.navigationItem.hidesBackButton = NO;
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
   144
            [self.navigationController pushViewController:nextController animated:YES];
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
   145
        } else {
3783
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
   146
            playSound(@"clickSound");
3701
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
   147
            nextController.navigationItem.hidesBackButton = YES;
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
   148
            [targetController.navigationController pushViewController:nextController animated:NO];
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
   149
        }
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   150
    }
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   151
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   152
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   153
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   154
#pragma mark -
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   155
#pragma mark Memory management
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   156
-(void) didReceiveMemoryWarning {
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   157
    // Releases the view if it doesn't have a superview.
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   158
    [super didReceiveMemoryWarning];
3697
d5b30d6373fc remove trailing spaces from end of line
koda
parents: 3662
diff changeset
   159
    // Relinquish ownership any cached data, images, etc that aren't in use.
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   160
    if (generalSettingsViewController.view.superview == nil)
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   161
        generalSettingsViewController = nil;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   162
    if (teamSettingsViewController.view.superview == nil)
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   163
        teamSettingsViewController = nil;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   164
    if (weaponSettingsViewController.view.superview == nil)
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   165
        weaponSettingsViewController = nil;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   166
    if (schemeSettingsViewController.view.superview == nil)
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   167
        schemeSettingsViewController = nil;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   168
    MSG_MEMCLEAN();
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   169
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   170
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   171
-(void) viewDidUnload {
3701
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
   172
    self.targetController = nil;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   173
    self.controllerNames = nil;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   174
    self.lastIndexPath = nil;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   175
    generalSettingsViewController = nil;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   176
    teamSettingsViewController = nil;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   177
    weaponSettingsViewController = nil;
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   178
    schemeSettingsViewController = nil;
3662
a44406f4369b polish polish polish polish (also: panning horizontal fix, panning momentum, settings page reworked yet again, memory leaks, crashes, segfaults)
koda
parents: 3547
diff changeset
   179
    MSG_DIDUNLOAD();
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   180
    [super viewDidUnload];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   181
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   182
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   183
-(void) dealloc {
3701
8c449776ebe6 rewrite portions of some uiviewcontrollers
koda
parents: 3697
diff changeset
   184
    targetController = nil;
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   185
    [controllerNames release];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   186
    [lastIndexPath release];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   187
    [generalSettingsViewController release];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   188
    [teamSettingsViewController release];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   189
    [weaponSettingsViewController release];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   190
    [schemeSettingsViewController release];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   191
    [super dealloc];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   192
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   193
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   194
-(IBAction) dismissSplitView {
3783
8e9daf967406 X&Y buttons, sounds for some buttons, cleanup
koda
parents: 3737
diff changeset
   195
    playSound(@"backSound");
3547
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   196
    [[NSNotificationCenter defaultCenter] postNotificationName:@"dismissModalView" object:nil];
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   197
}
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   198
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   199
@end
02875b1145b7 i <3 mercurial
koda
parents: 3546
diff changeset
   200