0

I started with an iPhone-only app, which worked fine on both iPhone and iPad (it ran in a small, iPhone-sized window on the iPad... which was fine). Then I selected iPhone/iPad for the Target Device Family, and created a blank MyViewController~ipad.xib. Then I decided to revert the app to its former self, and I deleted the ~ipad.xib and set the Target Device Family back to iPhone only.

Now, my view is displayed as before on the iPad, but I cannot interact with the view. Everything works properly on the iPhone, but on the iPad, it seems like my buttons are not linked to their corresponding actions. But, there is only on nib now, so obviously those buttons are linked, because they work on the iPhone.

Per @wrights suggestion, I deleted all of the simulator files and clean the project again. Then I got a new error: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/hap/Library/Application Support/iPhone Simulator/5.1/Applications/83BECBAA-2558-4927-9347-FAC972168299/WxT.app> (loaded)' with name 'MainWindow-iPad''

The app just crashes at this point.

I'd like to get the app working properly on the iPad, as it was before... with just the single nib. Any help would be very much appreciated!

Hap
  • 556
  • 1
  • 6
  • 20

2 Answers2

1

It turns out there was an entry in Info.plist that was causing the issue. This question "iOS Development: How can I prevent an iPad from running a universal app in iPad mode?" helped me find it.

Image of plist with entry: 'Main nib file base name (iPad)

Once I deleted the iPad related entry, that cleared up the original issue and new error.

Community
  • 1
  • 1
Hap
  • 556
  • 1
  • 6
  • 20
0

Make sure you have cleaned your build and removed the app from the iPad before running the reverted app. By not deleting the app from the device, those iPad files possibly remain in the application bundle, even though you removed them from the project.

1.) Delete the app from Simulator and Device, completely.

2.) Clean Build.

3.) Run reverted app on the device of your choice.

In Xcode

Navigate to the menu item Product then down to Clean as shown in the screenshot, or simply press Shift+Command ⌘+K

enter image description here

Community
  • 1
  • 1
WrightsCS
  • 50,551
  • 22
  • 134
  • 186
  • I should have mentioned that I did delete the simulator files, since these were the root of [another issue I just tackled](http://stackoverflow.com/questions/10884640/added-then-deleted-a-ipad-xib-now-nsinternalinconsistencyexception-when-runni). I have only tried this on a simulator... I do not have an iPad for testing at the moment. I cleaned as well. Tried both of these steps one more time, just to be sure, and still have the issue. – Hap Jun 04 '12 at 21:43
  • Did you make sure to change back **Target Device** to only **iPhone**? – WrightsCS Jun 04 '12 at 21:48
  • Back to my desk. I deleted Simulator files and cleaned again. Now I see this error: `*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'MainWindow-iPad''` So it seems something is still looking for the iPad specific nib, not sure why. – Hap Jun 05 '12 at 12:31