project_files/HedgewarsMobile/Classes/SplitViewRootController.m
changeset 5219 9e2a17ab178b
parent 5208 878e551f0b4a
child 6000 dbcebcd3d79f
equal deleted inserted replaced
5218:bc31676ae108 5219:9e2a17ab178b
    43     CGRect rect = [[UIScreen mainScreen] bounds];
    43     CGRect rect = [[UIScreen mainScreen] bounds];
    44     self.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
    44     self.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
    45 
    45 
    46     if (self.activeController == nil) {
    46     if (self.activeController == nil) {
    47         MasterViewController *rightController = [[MasterViewController alloc] initWithStyle:UITableViewStyleGrouped];
    47         MasterViewController *rightController = [[MasterViewController alloc] initWithStyle:UITableViewStyleGrouped];
       
    48         rightController.rootController = self;
    48         rightController.targetController = nil;
    49         rightController.targetController = nil;
    49         self.activeController = rightController;
    50         self.activeController = rightController;
    50         [rightController release];
    51         [rightController release];
    51     }
    52     }
    52     self.rightNavController = [[UINavigationController alloc] initWithRootViewController:self.activeController];
    53     self.rightNavController = [[UINavigationController alloc] initWithRootViewController:self.activeController];
    53 
    54 
    54     if (IS_IPAD()) {
    55     if (IS_IPAD()) {
    55         MasterViewController *leftController = [[MasterViewController alloc] initWithStyle:UITableViewStylePlain];
    56         MasterViewController *leftController = [[MasterViewController alloc] initWithStyle:UITableViewStylePlain];
       
    57         leftController.rootController = self;
    56         leftController.targetController = self.activeController;
    58         leftController.targetController = self.activeController;
    57         UINavigationController *leftNavController = [[UINavigationController alloc] initWithRootViewController:leftController];
    59         UINavigationController *leftNavController = [[UINavigationController alloc] initWithRootViewController:leftController];
    58         [leftController release];
    60         [leftController release];
    59 
    61 
    60         self.splitViewRootController = [[UISplitViewController alloc] init];
    62         self.splitViewRootController = [[UISplitViewController alloc] init];
    70         self.rightNavController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
    72         self.rightNavController.view.frame = CGRectMake(0, 0, rect.size.height, rect.size.width);
    71         [self.view addSubview:self.rightNavController.view];
    73         [self.view addSubview:self.rightNavController.view];
    72     }
    74     }
    73 
    75 
    74     [super viewDidLoad];
    76     [super viewDidLoad];
       
    77 }
       
    78 
       
    79 -(void) dismissModalViewControllerAnimated:(BOOL)animated {
       
    80     playSound(@"backSound");
       
    81     [self.parentViewController dismissModalViewControllerAnimated:YES];
    75 }
    82 }
    76 
    83 
    77 -(void) viewDidUnload {
    84 -(void) viewDidUnload {
    78     self.activeController = nil;
    85     self.activeController = nil;
    79     self.rightNavController = nil;
    86     self.rightNavController = nil;