project_files/HedgewarsMobile/Classes/SplitViewRootController.m
changeset 3535 9e78c1f3d8d8
parent 3514 59dbd31e9953
child 3546 ccf4854df294
equal deleted inserted replaced
3534:51521238724f 3535:9e78c1f3d8d8
    36 
    36 
    37     CGRect rect = [[UIScreen mainScreen] bounds];
    37     CGRect rect = [[UIScreen mainScreen] bounds];
    38     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    38     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    39         self.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
    39         self.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
    40         
    40         
    41     Class splitViewControllerClass = NSClassFromString(@"UISplitViewController");
    41     if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
    42     if (splitViewControllerClass) {
       
    43 #if __IPHONE_3_2
       
    44         UISplitViewController *splitViewRootController = [[UISplitViewController alloc] init];
    42         UISplitViewController *splitViewRootController = [[UISplitViewController alloc] init];
    45         //splitViewRootController.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;        
    43         //splitViewRootController.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;        
    46         splitViewRootController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
    44         splitViewRootController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
    47         
    45         
    48         MasterViewController *masterViewController = [[MasterViewController alloc] initWithStyle:UITableViewStylePlain];
    46         MasterViewController *masterViewController = [[MasterViewController alloc] initWithStyle:UITableViewStylePlain];
    55         [mainNavController release];
    53         [mainNavController release];
    56         [detailedNavController release];
    54         [detailedNavController release];
    57         
    55         
    58         // add view to main controller
    56         // add view to main controller
    59         [self.view addSubview:splitViewRootController.view];
    57         [self.view addSubview:splitViewRootController.view];
    60 #endif
       
    61     } else {
    58     } else {
    62         [self.view addSubview:detailedNavController.view];
    59         [self.view addSubview:detailedNavController.view];
    63     }
    60     }
    64 
    61 
    65     [super viewDidLoad];
    62     [super viewDidLoad];