如何在单击按钮时将Nib文件中的视图加载到iPad的DetailView中,并在子视图中单击另一个按钮时返回上一个视图。
答案 0 :(得分:1)
答案 1 :(得分:1)
以下代码应引导您朝着正确的方向前进。
加载新的ViewController:
- (IBAction)myBtnPushed{
NSLog(@"myBtnPushed");
NewRightVC *newRightVC = [[NewRightVC alloc] initWithNibName:@"NewRightVC" bundle:[NSBundle mainBundle]];
[detailViewController.navigationController pushViewController:newRightVC animated:YES];
NewLeftVC *newLeftVC = [[NewLeftVC alloc] initWithNibName:@"NewLeftVC" bundle:[NSBundle mainBundle]];
[self.navigationController pushViewController:newLeftVC animated:YES];
}
回到UISplitViewController中的RootViewController和DefaultViewController:
[detailViewController.navigationController popViewControllerAnimated:YES];
[self.navigationController popViewControllerAnimated:YES];