iOS中storyboard的问题

查看:74
本文介绍了iOS中storyboard的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

storyboard中设置了两个界面。

在代码中使用

[self.navigationController pushViewController:[[SCMainViewController alloc]init] animated:YES];

怎么跳转过去没有加载啊

不能再用纯代码方式去跳转了吗。。只能用segue吗

解决方案

 UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"xxx" bundle:nil];
 SCMainViewController *vc = [storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([SCMainViewController class])];
 [self.navigationController pushViewController:vc animated:YES];

这篇关于iOS中storyboard的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆