美文网首页
Application tried to push a nil

Application tried to push a nil

作者: 请叫我小鹏哥儿 | 来源:发表于2016-11-21 15:58 被阅读0次

1.原因:

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

2.修改方法:

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

3.实例

UIStoryboard *stroyboard = [UIStoryboard   storyboardWithName:@"XXX"bundle:nil];

PhoneRegisterController *infoVC = [stroyboard   instantiateViewControllerWithIdentifier:@"PhoneRegisterControllerID"];

[self.navigationController  pushViewController:prVCanimated:YES];

相关文章

网友评论

      本文标题:Application tried to push a nil

      本文链接:https://www.haomeiwen.com/subject/veuupttx.html