project_files/HedgewarsMobile/Classes/MainMenuViewController.m
changeset 5219 9e2a17ab178b
parent 5208 878e551f0b4a
child 5220 76a2246f18f0
equal deleted inserted replaced
5218:bc31676ae108 5219:9e2a17ab178b
    91 
    91 
    92 #pragma mark -
    92 #pragma mark -
    93 -(void) viewDidLoad {
    93 -(void) viewDidLoad {
    94     [super viewDidLoad];
    94     [super viewDidLoad];
    95 
    95 
    96     // listen to request to remove the modalviewcontroller (needed due to the splitcontroller)
       
    97     [[NSNotificationCenter defaultCenter] addObserver:self
       
    98                                              selector:@selector(dismissModalViewController)
       
    99                                                  name: @"dismissModalView"
       
   100                                                object:nil];
       
   101 
       
   102     // get the app's version
    96     // get the app's version
   103     NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey];
    97     NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleVersionKey];
   104 
    98 
   105     // get the version number that we've been tracking
    99     // get the version number that we've been tracking
   106     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
   100     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
   208             [alert release];
   202             [alert release];
   209             break;
   203             break;
   210     }
   204     }
   211 }
   205 }
   212 
   206 
   213 // must be kept for compatibility with the settings page
       
   214 -(void) dismissModalViewController {
       
   215     [self dismissModalViewControllerAnimated:YES];
       
   216 }
       
   217 
       
   218 -(void) viewDidUnload {
   207 -(void) viewDidUnload {
   219     [[NSNotificationCenter defaultCenter] removeObserver:self];
       
   220     self.gameConfigViewController = nil;
   208     self.gameConfigViewController = nil;
   221     self.settingsViewController = nil;
   209     self.settingsViewController = nil;
   222     self.aboutViewController = nil;
   210     self.aboutViewController = nil;
   223     self.savedGamesViewController = nil;
   211     self.savedGamesViewController = nil;
   224     MSG_DIDUNLOAD();
   212     MSG_DIDUNLOAD();