Xcode中的错误“未设置视图出口". [英] Error in Xcode "the view outlet was not set.'"

查看:56
本文介绍了Xcode中的错误“未设置视图出口".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Xcode中遇到问题.每次我在Simulator中运行我的应用程序时,该应用程序都会在黑屏视图中停止,调试器将编写以下代码:

2012-07-04 11:54:08.348 myApp [661:f803] * 由于以下原因终止了应用 未捕获的异常"NSInternalInconsistencyException",原因: '-[UIViewController _loadViewFromNibNamed:bundle:]已加载 "myappViewController"笔尖,但未设置视图出口.'

在网上搜索我已阅读,以设置视图和"Outlet中的视图"之间的链接.

对于文件的所有者"->连接检查器"->插座" ,我已将视图链接到视图.

结果始终相同.同样的错误.

还有另一种绕过此问题的方法吗?

谢谢大家

解决方案

尝试在界面构建器中选择文件的所有者,在属性检查器(悬停帮助中称为Identity Inspector)中选择第三个选项卡,并确保自定义类属性设置为'myappViewController'

还可以通过在Interface Builder中选择根视图来检查根UIView是否已连接到文件的所有者",再选择属性检查器中的最后一个选项卡(在悬停帮助中称为Connection Inspector),然后检查引用出口. /p>

请记住要检查名称的大小写在两个地方是否匹配.

I've a problem in Xcode. Every time I run my app in Simulator, the app is stopped in a black screen view and the debugger write this code:

2012-07-04 11:54:08.348 myApp[661:f803] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "myappViewController" nib but the view outlet was not set.'

Searching through the web I've read to set the link between view and View in Outlets.

For "File's Owner" -> "Connections inspector" -> "Outlets" I have linked view to View.

The result is always the same. Same error.

There's another way to bypass this problem?

Thanks everyone

解决方案

try to select file's owner in interface builder select tab number three in the property inspector (called Identity Inspector in the hover-over help) and make sure the Custom Class property is set to 'myappViewController'

Also check that root UIView is hooked up to 'File's owner' by selecting your root view in Interface Builder select the last tab in the property inspector (called Connection Inspector in the hover-over help) and check the Referencing Outlets.

remember to check that casing of names matches in both places.

这篇关于Xcode中的错误“未设置视图出口".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆