Terminating with uncaught exception of type NSException (xcode 6)

*爱你&永不变心* 提交于 2020-01-02 10:02:52

问题


Terminating app due to uncaught exception:

'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ViewController" nib but the view outlet was not set.

I am getting this error in xcode 6. I know how to set view outlet in xcode 5 or below version (go to connection inspector drag outlet radio button to file's Owner then it pop with a view and then click on view sets the outlet) but view popup is not comming in xcode 6 (beta). Is it a xcode 6 bug or it has different way to set an outlet. Can anyone help please?


回答1:


It means you have a view controller, but you have not set the view outlet. In interface builder, right click on the view controller, and outlet and action popup will appear. Find the view outlet, and drag it to the topmost view in the views list.




回答2:


I had this problem and basically it was due to a button being assigned to an outlet (which i did not need) and and action that I was actually using. To resolve this type of issue, you need to make sure that your buttons are correctly assigned and get rid of any outlets that you do not need or that you may have added by mistake.




回答3:


It happens to me when you changed ui element in storyboard, didn't clean them completely. Just right click on the top view controller, and it will show which one should be deleted



来源:https://stackoverflow.com/questions/24068971/terminating-with-uncaught-exception-of-type-nsexception-xcode-6

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!