Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOs device-specific resources not working - ~iPad loading default XIB - universal app

I'm making a universal app based on the Utility App template. I've selected a universal app and the MainView.xib and MainView~iPad.xib work properly on both device types.

On the iPad2, when I switch to the FlipsideView, it loads FlipsideView.xib even though there is a perfectly good FlipsideView~iPad.xib file in the project. The default xib is normal (iPhone) sized and displaying in the lower left hand corner of the iPad.

I did have to create the FlipsideView~iPad xib manually. I believe I have the xib properly wired in IB as it shows identical to the FlipsideView.xib connections.

Over the last couple weeks, I've read quite a few posts with similar problems and this Stack Overflow thread answers most clearly and contains links to Apple documentation. So I know it works for others and is documented.

The code for this section is identical to the showInfo() method in the stock Utility App template.

(Yes I realize I can manually load the ~iPad version checking UI_USER_INTERFACE_IDIOM(). I'm trying to figure out what I'm doing wrong in getting the ~iPad modifier to work.)

Any ideas what I'm missing?

Thanks a ton for your help!

like image 893
David Vondracek Avatar asked Jun 12 '11 00:06

David Vondracek


1 Answers

in the end i found the solution. it is really very very simple. The xib must be named ~ipad instead of ~iPad, and ~iphone instead of ~iPhone. The bad thing is the if you name them ~iPad, everything works in the simulator but it does not work on the real device.

like image 125
pdenti Avatar answered Sep 25 '22 02:09

pdenti