我正在使用 Storyboard 浏览我的 View Controller 。我有一个名为 (RootVC) 的 Root View Controller ,我已经通过“推送”segue 连接到下一个 View Controller (称为 SecondVC)。我在 RootVC 中有一个按钮,按下时调用 pushViewController
。
当我运行它时,我最终看到以下错误:
* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "SecondVC" nib but the view outlet was not set.'
我环顾四周,看到很多人建议 UIView 没有正确连接到 xib 中。我正在使用 Storyboard,所以它有点不同,但我仍然可以看到我的 SecondVC 的 View 导出连接到属于它的 UIView。从外观上看,Storyboard 默认建立了这种关联。
有人知道可能出了什么问题吗?如果需要我的 Storyboard 的屏幕截图,我可以提供。
提前致谢。
最佳答案
我遇到了同样的问题,确保你没有
@synthesize view;
在你的 viewcontroller .m 文件中。
关于xcode - UIViewController _loadViewFromNibNamed :bundle loaded the "XXXViewController" nib but the view outlet was not set. ' -*使用 Storyboard*,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13394099/