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

iOS使用XIB文件报错:reason: 'A view can only be associated with at most one view controller at a time!

2017-09-09 16:16 537 查看
分析原因:

由于控制器的xib文件名称和类名不一致,需要进行修改才可以,或者更改加载方法解决。

解决办法:

ViewController *vc = [[NSBundle mainBundle] loadNibNamed:

    @"ViewController" owner:nil options:nil ].lastObject;

[self.navigationController pushViewController:vc animated:YES];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  UIViewControllerHier
相关文章推荐