码迷,mamicode.com
首页 > 移动开发 > 详细

[转]IOS, xib和storyboard的混用

时间:2015-07-08 12:26:15      阅读:129      评论:0      收藏:0      [点我收藏+]

标签:

1. 从xib的viewcontroll中启动storyboard 或者 从一个storyboard切换到另一个storyboard:

[objc]
– (IBAction)openStoryboard:(id)sender {
UIStoryboard *secondStoryboard = [UIStoryboard storyboardWithName:@"SecondStoryboard" bundle:nil];
[self presentModalViewController:[secondStoryboard instantiateInitialViewController] animated:YES];
}
[/objc]

2. 从storyboard切换到xib:

[objc]
LoginViewController *loginViewController = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
[/objc]

然后用push或者modal方法启用这个controller

3. 从xib或者storyboard中启动里一个storyboard的某一个controller上:

[objc]
[storyboard instantiateViewControllerWithIdentifier"actionList"];
[/objc]

[转]IOS, xib和storyboard的混用

标签:

原文地址:http://www.cnblogs.com/killiancheung/p/4629637.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!