Added, then deleted a ~ipad.xib. Now NSInternalInconsistencyException when running on iPad

南楼画角 提交于 2020-01-23 17:19:47

问题


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.

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', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "MyViewController" nib but the view outlet was not set.'"

The view outlet in MyViewController.xib is set:

And File's Owner class is set:

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!


回答1:


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.

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



来源:https://stackoverflow.com/questions/10884640/added-then-deleted-a-ipad-xib-now-nsinternalinconsistencyexception-when-runni

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