ios 以未捕获的 NSException 类型异常终止(xcode 6)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24068971/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 00:33:18  来源:igfitidea点击:

Terminating with uncaught exception of type NSException (xcode 6)

iosios7ios6xcode5

提问by Brammanand Soni

Terminating app due to uncaught exception:

由于未捕获的异常而终止应用程序:

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

'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "ViewController"笔尖但未设置视图插座。

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?

我在 xcode 6 中遇到此错误。我知道如何在 xcode 5 或以下版本中设置视图插座(转到连接检查器将插座单选按钮拖到文件的所有者,然后它弹出一个视图,然后单击视图设置插座)但是xcode 6(测试版)中没有出现视图弹出窗口。它是 xcode 6 错误还是设置插座的方式不同。有人可以帮忙吗?

回答by Leo Natan

It means you have a view controller, but you have not set the viewoutlet. 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.

这意味着您有一个视图控制器,但您还没有设置view插座。在界面生成器中,右键单击视图控制器,将出现出口和操作弹出窗口。找到视图出口,并将其拖到视图列表中的最顶部视图。

回答by Ronaldoh1

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.

我遇到了这个问题,基本上是由于一个按钮被分配给了一个插座(我不需要)和我实际使用的动作。要解决此类问题,您需要确保正确分配按钮,并清除不需要或可能错误添加的任何插座。

回答by ForeverYang

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

当您更改故事板中的 ui 元素时,我发生了这种情况,但没有完全清理它们。只需右键单击顶部视图控制器,它就会显示应该删除哪个