project_files/HedgewarsMobile/Classes/DetailViewController.m
author koda
Thu, 17 Jun 2010 20:30:39 +0200
changeset 3514 59dbd31e9953
parent 3513 cocoaTouch/DetailViewController.m@f589230fa21b
child 3535 9e78c1f3d8d8
permissions -rw-r--r--
move stuff around and update iphone project
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
     1
    //
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
     2
//  DetailViewController.m
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
     3
//  HedgewarsMobile
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
     4
//
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
     5
//  Created by Vittorio on 27/03/10.
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
     6
//  Copyright 2010 __MyCompanyName__. All rights reserved.
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
     7
//
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
     8
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
     9
#import "DetailViewController.h"
3312
6d8f1c76756d restore and update the old general settings
koda
parents: 3308
diff changeset
    10
#import "SDL_uikitappdelegate.h"
3356
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    11
#import "GeneralSettingsViewController.h"
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    12
#import "TeamSettingsViewController.h"
3356
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    13
#import "WeaponSettingsViewController.h"
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    14
#import "SchemeSettingsViewController.h"
3335
2520ee7a5484 new manager for handling (future) rotations
koda
parents: 3316
diff changeset
    15
#import "CommodityFunctions.h"
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    16
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    17
@implementation DetailViewController
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    18
@synthesize controllerNames,popoverController;
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    19
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    20
3335
2520ee7a5484 new manager for handling (future) rotations
koda
parents: 3316
diff changeset
    21
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation {
2520ee7a5484 new manager for handling (future) rotations
koda
parents: 3316
diff changeset
    22
	return rotationManager(interfaceOrientation);
2520ee7a5484 new manager for handling (future) rotations
koda
parents: 3316
diff changeset
    23
}
2520ee7a5484 new manager for handling (future) rotations
koda
parents: 3316
diff changeset
    24
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    25
-(void) willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    26
    self.view.frame = CGRectMake(0, 0, 1024, 1024);
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    27
}
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
    28
3357
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    29
-(void) viewDidLoad {
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    30
    self.title = NSLocalizedString(@"Settings",@"");
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    31
3316
52f0482b043f fix a couple of leaks in hte ifrontend
koda
parents: 3312
diff changeset
    32
    // allocate controllers and store them into the array
3356
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    33
    NSArray *array= [[NSArray alloc] initWithObjects:NSLocalizedString(@"General",@""), 
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    34
                                                     NSLocalizedString(@"Teams",@""),
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    35
                                                     NSLocalizedString(@"Weapons",@""),
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    36
                                                     NSLocalizedString(@"Schemes",@""),
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    37
                                                     nil];
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    38
    self.controllerNames = array;
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    39
    [array release];
3316
52f0482b043f fix a couple of leaks in hte ifrontend
koda
parents: 3312
diff changeset
    40
    
52f0482b043f fix a couple of leaks in hte ifrontend
koda
parents: 3312
diff changeset
    41
    // on ipad make the general setting the first view, on iphone add the "Done" button on top left
52f0482b043f fix a couple of leaks in hte ifrontend
koda
parents: 3312
diff changeset
    42
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
3356
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    43
        
3357
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    44
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(112, 112, 480, 320)];
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    45
        label.text = @"Press the buttons on the left";
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    46
        label.font = [UIFont systemFontOfSize:20];
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    47
        label.textAlignment = UITextAlignmentCenter;
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    48
        [self.view addSubview:label];
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    49
        [label release];
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    50
        
3356
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    51
        //[self.navigationController pushViewController:nextController animated:NO];
3316
52f0482b043f fix a couple of leaks in hte ifrontend
koda
parents: 3312
diff changeset
    52
    } else {
3356
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    53
        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    54
                                                                                              target:self
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    55
                                                                                              action:@selector(dismissSplitView)];
3316
52f0482b043f fix a couple of leaks in hte ifrontend
koda
parents: 3312
diff changeset
    56
    }
52f0482b043f fix a couple of leaks in hte ifrontend
koda
parents: 3312
diff changeset
    57
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    58
    [super viewDidLoad];
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    59
}
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    60
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    61
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    62
#pragma mark -
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    63
#pragma mark Table view data source
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    64
-(NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
3357
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    65
    // don't display 
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    66
    if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    67
        return 0;
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    68
    else
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    69
        return 1;
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    70
}
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    71
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    72
-(NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
3356
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    73
    return [controllerNames count];
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    74
}
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    75
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    76
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    77
    static NSString *CellIdentifier = @"Cell";
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    78
    
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    79
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    80
    if (cell == nil) {
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    81
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault 
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    82
                                       reuseIdentifier:CellIdentifier] autorelease];
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    83
    }
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    84
    
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    85
    NSInteger row = [indexPath row];
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    86
    
3356
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    87
    cell.textLabel.text = [controllerNames objectAtIndex:row];
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    88
    cell.imageView.image = [UIImage imageNamed:@"Icon.png"];
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    89
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    90
    
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    91
    return cell;
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    92
}
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    93
3357
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    94
#pragma mark -
3836a31879e7 draw a hedgehog when presenting hats
koda
parents: 3356
diff changeset
    95
#pragma mark Table view delegate
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    96
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
    97
    NSInteger row = [indexPath row];
3364
e5403e2bf02c no more hardcoded teams, team selection is real \o/
koda
parents: 3357
diff changeset
    98
    UIViewController *nextController = nil;
3356
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
    99
    
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   100
    switch (row) {
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   101
        case 0:
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   102
            if (nil == generalSettingsViewController)
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   103
                generalSettingsViewController = [[GeneralSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   104
            nextController = generalSettingsViewController;
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   105
            break;
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   106
        case 1:
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   107
            if (nil == teamSettingsViewController)
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   108
                teamSettingsViewController = [[TeamSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   109
            nextController = teamSettingsViewController;
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   110
            break;
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   111
        case 2:
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   112
            if (nil == weaponSettingsViewController)
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   113
                weaponSettingsViewController = [[WeaponSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   114
            nextController = weaponSettingsViewController;
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   115
            break;
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   116
        case 3:
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   117
            if (nil == schemeSettingsViewController)
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   118
                schemeSettingsViewController = [[SchemeSettingsViewController alloc] initWithStyle:UITableViewStyleGrouped];
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   119
            nextController = schemeSettingsViewController;
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   120
            break;
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   121
    }
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   122
    
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   123
    nextController.title = [controllerNames objectAtIndex:row];
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
   124
    [self.navigationController pushViewController:nextController animated:YES];
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
   125
}
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
   126
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   127
-(IBAction) dismissSplitView {
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   128
    [[NSNotificationCenter defaultCenter] postNotificationName:@"dismissModalView" object:nil];
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
   129
}
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
   130
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   131
#if __IPHONE_3_2
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
   132
#pragma mark -
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   133
#pragma mark splitview support
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   134
-(void) splitViewController:(UISplitViewController *)svc popoverController:(UIPopoverController *)pc willPresentViewController:(UIViewController *)aViewController {
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   135
    if (popoverController != nil) {
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   136
        [popoverController dismissPopoverAnimated:YES];
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   137
    }
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
   138
}
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
   139
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   140
// Called when the master view controller is about to be hidden
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   141
-(void) splitViewController: (UISplitViewController*)svc willHideViewController:(UIViewController *)aViewController 
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   142
            withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController: (UIPopoverController*)pc {
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   143
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   144
  /*  barButtonItem.title = @"Master View";
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   145
    UIToolbar *toolbar = self.parentViewController.navigationController.toolbar;
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   146
    NSMutableArray *items = [[toolbar items] mutableCopy];
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   147
    [items insertObject:barButtonItem atIndex:0];
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   148
    [toolbar setItems:items animated:YES];
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   149
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   150
    [items release];
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   151
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   152
    self.popoverController = pc;*/
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   153
    barButtonItem.title = aViewController.title;
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   154
    self.navigationItem.rightBarButtonItem = barButtonItem;
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
   155
}
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   156
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   157
// Called when the master view controller is about to appear
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   158
-(void) splitViewController: (UISplitViewController*)svc  willShowViewController:(UIViewController *)aViewController 
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   159
            invalidatingBarButtonItem:(UIBarButtonItem *)barButtonItem {
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   160
    /*UIToolbar *toolbar = self.parentViewController.navigationController.toolbar;
3316
52f0482b043f fix a couple of leaks in hte ifrontend
koda
parents: 3312
diff changeset
   161
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   162
    NSMutableArray *items = [[toolbar items] mutableCopy];
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   163
    [items removeObjectAtIndex:0];
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   164
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   165
    [toolbar setItems:items animated:YES];
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   166
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   167
    [items release];
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   168
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   169
    self.popoverController = nil;*/
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   170
        self.navigationItem.rightBarButtonItem = nil;
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   171
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
   172
}
3513
f589230fa21b now it's possible to select the scheme file in the ifrontendfix a type about loading an image (iphone file system IS case senstive)
koda
parents: 3490
diff changeset
   173
#endif
3356
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   174
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   175
-(void) didReceiveMemoryWarning {
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   176
    // Releases the view if it doesn't have a superview.
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   177
    [super didReceiveMemoryWarning];
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   178
    // Release any cached data, images, etc that aren't in use.
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   179
    if (generalSettingsViewController.view.superview == nil)
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   180
        generalSettingsViewController = nil;
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   181
    if (teamSettingsViewController.view.superview == nil)
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   182
        teamSettingsViewController = nil;
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   183
    if (weaponSettingsViewController.view.superview == nil)
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   184
        weaponSettingsViewController = nil;
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   185
    if (schemeSettingsViewController.view.superview == nil)
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   186
        schemeSettingsViewController = nil;
3487
b1d00f1950c8 add some memory aware code
koda
parents: 3374
diff changeset
   187
    MSG_MEMCLEAN();
3356
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   188
}
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   189
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   190
-(void) viewDidUnload {
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   191
    self.controllerNames = nil;
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   192
    generalSettingsViewController = nil;
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   193
    teamSettingsViewController = nil;
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   194
    weaponSettingsViewController = nil;
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   195
    schemeSettingsViewController = nil;
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   196
    [super viewDidUnload];
3490
016b3172b645 a bunch of minor stuff
koda
parents: 3487
diff changeset
   197
    MSG_DIDUNLOAD();
3356
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   198
}
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   199
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   200
-(void) dealloc {
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   201
    [controllerNames release];
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   202
    [generalSettingsViewController release];
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   203
    [teamSettingsViewController release];
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   204
    [weaponSettingsViewController release];
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   205
    [schemeSettingsViewController release];
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   206
    [super dealloc];
3ae3fccb439e add missing controller stubs
koda
parents: 3335
diff changeset
   207
}
3305
91074496d5c9 merged code from ipad and iphone frontends
koda
parents:
diff changeset
   208
@end