Application tried to push a nil
2016-11-21 本文已影响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];