关于storyBoard的小知识点

时间:2014-02-09 15:32:57   收藏:0   阅读:339

storyBoard确实能减少不少代码量,但是不利于核实代码,所以用的相对少一点

下面是怎么读取storyBoard的代码,及推出下个界面

 //第一种,如果当前的控制器视图是里面的一个视图,那么用这个

    UIStoryboard *storyBoard=self.storyboard;

    //第二种是在本地查找

    UIStoryboard *storyBoard=[UIStoryboard storyboardWithName:@"Main" bundle:nil];

 

    RegisterViewController *registerView=[storyBoard instantiateViewControllerWithIdentifier:@"RegisterViewController"];

    [self.navigationControllerpushViewController:registerView animated:YES];

    //第三种 通过segue完成push

    //这种在storyBoard里可以给它设定标示了,来查找,另外可以设定退出类型

    [selfperformSegueWithIdentifier:@"LoginToRegister"sender:self];

以后有什么问题继续补充

原文:http://www.cnblogs.com/lingzhiguiji/p/3540535.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!