ios - A控制器跳转B控制器,B黑屏?

查看:89
本文介绍了ios - A控制器跳转B控制器,B黑屏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

1.storyBoard中有2个VC,分别套了导航。

2.AVC跳转BVC的方法,button连线的方法

- (IBAction)clickBtnToBvc:(id)sender {
    BViewController *vc = [[BViewController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}

3.BVC黑屏,请问是什么原因?

解决方案

你的B是在storyboard中创建的并绑定控件,所以要从storyboard加载

BViewController * vc = [[UIStoryboard storyboardWithName:@"storyboard" bundle:nil] instantiateViewControllerWithIdentifier:@"IDENTITY"];
[self.navigationController pushViewController:vc animated:YES];

这篇关于ios - A控制器跳转B控制器,B黑屏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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