2011-01-05 54 views

回答

1

下面的代碼應該引導你在正確的方向。

要加載新的視圖控制器:

- (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]; 
} 

要返回到RootViewController的和DefaultViewController在UISplitViewController:

[detailViewController.navigationController popViewControllerAnimated:YES]; 

[self.navigationController popViewControllerAnimated:YES]; 

Example Project to examine can be downloaded here.

Example obtained from this post: https://stackoverflow.com/questions/5263128/splitviewcontroller-with-two-navigationcontroller-linking-protocols

相關問題