[self presentViewController:loginC animated:YES completion:nil];
这种方法不试用于storyboard创建的控制器(参考第3点)
1.纯代码创建
直接创建两个控制器,给A控制器绑定一个事件,使用presentViewController方法跳转页面
用dismissViewControllerAnimated方法回来。(但是这种方法并不会加载B的sb)
2.在SB中给A控制器btn绑定一个页面跳转,点击A就能跳到B了
3.最初的错了,那是因为选择的连线方式错误了,如果选择push就能使用presentViewController方法进行跳转,其他的连线方式没有试过。
4.第3点错了,跳转的只是B类创建的页面,并没有加载B的sb
5.利用segueID: storyboard segue 设置一个segueID, 用performSegueWithIdentifier 方法进行触发一个指定的segue跳转。
[self performSegueWithIdentifier:@"atob" sender:sender];
用diss返回
5.用SB的Identifier的值执行绑定跳转
ViewController *view3 = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"kkkk"];
[self presentViewController:view3 animated:YES completion:nil];
网友评论