您的位置:首页 > 移动开发

Application tried to push a nil view controller on target <UINavigationControlle

2016-09-27 15:21 603 查看
1.原因:

采用self.storyboard时,获得的storyboard对象为空

2.修改方法:

初始化一个storyboard对象,然后使用这个对象获得相应的viewcontroller;

3.代码演示:

UIStoryboard *stroyboard = [UIStoryboard storyboardWithName:@"Setting" bundle:nil];
PerfectPersonalInfoViewController *infoVC = [stroyboard instantiateViewControllerWithIdentifier:@"PerfectPersonalInfoVCStoryBoardID"];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:infoVC];
infoVC.info = data;
infoVC.detail = wechatinfo;
[self presentViewController:nav animated:YES completion:nil];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ios
相关文章推荐