SIGABRT Error “view outlet was not set”

大憨熊 提交于 2019-12-11 19:09:01

问题


I'm receiving a SIGABRT error when attempting to run my application on my iPhone 5. My application basically requires 3 views, and depending on which device you're running (iPhone 4, iPhone 5 or iPad), it will launch the view specific to your device type.

The SIGABRT error:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ViewController_Portrait5" nib but the view outlet was not set.'

I'm almost positive that the view outlet was set, but I guess I'm wrong.

Here is a screenshot of Xcode window:


回答1:


You need to connect the "view" outlet. See how there is an item in that list "view" with no connection? You need to ensure that every UIViewController is connected to a view.

Since you named the file "portrait" I'm guessing that you'd like the view to be the portrait view, so connected the "view" outlet with the "Portrait" object, under "Objects."




回答2:


Just drag the little circle next to "view" above your "webView" to the first view.



来源:https://stackoverflow.com/questions/13780016/sigabrt-error-view-outlet-was-not-set

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