问题
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