Error in Xcode “the view outlet was not set.'”

人走茶凉 提交于 2019-12-11 03:21:57

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/11327239/error-in-xcode-the-view-outlet-was-not-set

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