添加,然后删除~ipad.xib。现在在iPad上运行时出现NSInternalInconsistencyException [英] Added, then deleted a ~ipad.xib. Now NSInternalInconsistencyException when running on iPad

查看:130
本文介绍了添加,然后删除~ipad.xib。现在在iPad上运行时出现NSInternalInconsistencyException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了将iPhone应用程序转换为通用应用程序,我在项目中添加了MyViewController~ipo.xib。我还将目标设备系列设置为iPhone / iPad。然后我尝试撤消这些更改 - 删除了MyViewController~ipad.xib并仅将目标设备系列设置为iPhone。

In an attempt to convert an iPhone app to a universal app, I added a MyViewController~ipad.xib to my project. I also set the Targeted Device Family to iPhone/iPad. I then attempted to undo those changes--deleted the MyViewController~ipad.xib and set Targeted Device Family to iPhone only.

现在,我可以在iPhone上运行(一如既往),但不能在iPad上运行(以前我可以做)。我现在崩溃了以下错误:

Now, I can run on iPhone (as always), but not on iPad (which I could do before). I now crash with the following error:


'NSInternalInconsistencyException',原因:' - [UIViewController
_loadViewFromNibNamed:bundle:]加载了MyViewController笔尖,但未设置视图插座。'

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

MyViewController.xib中的视图插座已设置:< img src =https://i.stack.imgur.com/EGd89.pngalt =显示视图出口设置为'查看'>

The view outlet in MyViewController.xib is set:

和文件的所有者类设置为:

And File's Owner class is set:

所以我想回到我所拥有的......一个仅在iPhone上运行的iPhone应用程序(但在较小的iPhone视图中)。任何帮助将不胜感激!

So I would like to just get back to what I had... an iPhone-only app that will run on the iPad (but in the smaller iPhone view). Any help would be appreciated!

推荐答案

请注意,如果从项目中删除文件,文件在重新安装时(通过Build& Run)从设备中删除,iOS仍会在那里看到您的旧文件。您可能需要从设备中手动删除应用程序,然后重新安装。

Be aware that if you remove files from your project, the files are not deleted from the device when re-installing (through Build&Run), and iOS will still see your old files there. You may need to manually remove the app from the device, then re-install.

另一个选项是重命名文件,以便旧文件不会打扰您。

Another option is to rename the file, so that old files will not bother you.

此外,清洁项目或清理构建文件夹(按住Alt并从产品菜单中选择清除)可能会有所帮助。

Also, cleaning the project, or cleaning the build folder (keep alt pressed and select Clean from the Product menu) may help.

这篇关于添加,然后删除~ipad.xib。现在在iPad上运行时出现NSInternalInconsistencyException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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