开发者

How to load another View in DetailViewController in iPad

开发者 https://www.devze.com 2023-02-02 05:59 出处:网络
How can I load a View from Nib file into DetailView for an iPad on a button cli开发者_Python百科ck and back to previous view on another button click present in child view.I found this site useful:

How can I load a View from Nib file into DetailView for an iPad on a button cli开发者_Python百科ck and back to previous view on another button click present in child view.


I found this site useful:

http://developer.apple.com/library/ios/#samplecode/MultipleDetailViews/Introduction/Intro.html#//apple_ref/doc/uid/DTS40009775


The following code should steer you in the right direction.

To load a new 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];
}

To go back to the RootViewController and DefaultViewController in a 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

0

精彩评论

暂无评论...
验证码 换一张
取 消