'NSInternalInconsistencyException',原因:' - [UIViewController _loadViewFromNibNamed:bundle:]加载了GameView笔尖,但未设置视图插座 [英] 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the GameView nib but the view outlet was not set

查看:629
本文介绍了'NSInternalInconsistencyException',原因:' - [UIViewController _loadViewFromNibNamed:bundle:]加载了GameView笔尖,但未设置视图插座的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这与此处众多其他类似问题的情况不同。

This is not the same situation as the multitude of other similar questions here.

*由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:' - [UIViewController _loadViewFromNibNamed:bundle:]加载了GameView nib但未设置视图插座。'

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

你可能会想按照它说的那样,将文件所有者连接到IB中的视图! 。但问题是,我甚至在项目中甚至在项目目录中都没有GameView.xib。

You might be thinking "do as it says, connect the File's Owner to the View in IB!". But the thing is, I don't even HAVE a GameView.xib in my project or even in the project directory.

我的项目中有一个GameViewController.m和匹配的GameViewController.xib。使用GameViewController会出现这个错误,但我不明白尝试加载GameView.xib的想法。它不应该使用GameViewController.xib吗?

I do have a "GameViewController.m" and matching "GameViewController.xib" in my project. Using that GameViewController is what brings up this error, but I don't understand where it gets the idea to try and load "GameView.xib". Shouldn't it use "GameViewController.xib" instead?

如果我grep我的项目目录,我确实看到它来自UserInterfaceState.xcuserstate。

If I grep my project directory, I do see it referenced from "UserInterfaceState.xcuserstate".

<string>file://localhost/Users/bemmu/Dropbox/b2/iphone/ValleyStory/ValleyStory/GameView.xib</string>

此提到的文件不存在。我之前可能有一个带有该名称的文件,并重命名/删除它,但它没有被我在IB中看到的任何地方引用。

This mentioned file does not exist. I might have had a file with that name before and renamed/deleted it, but it's not being referenced to from anywhere that I can see in IB.

我是否设法混淆xcode?

Did I manage to confuse xcode?

推荐答案

检查任何笔尖您正在使用的文件(如MainWindow.xib)。如果从笔尖加载GameViewController,请检查它正在加载的文件(在检查器的信息选项卡下)。确保它设置为GameViewController而不是GameView。

Check any nib files you're using (like MainWindow.xib). If you are loading GameViewController from a nib, check the file it's loading from (under the info tab in the inspector). Make sure it's set to "GameViewController" and not "GameView".

这篇关于'NSInternalInconsistencyException',原因:' - [UIViewController _loadViewFromNibNamed:bundle:]加载了GameView笔尖,但未设置视图插座的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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