Issue with xib files for iPad universal

I have a running iPhone app and I am trying to change it into an universal app in Xcode 3.2. I only want to create new xib files for iPad.

So I simply expand Targets click “ProjectUpgrade Current Target for iPad” and choose “One universal application”.

On my app I have a lot of xib files and I want to creat new iPad xib files for the same controller, for example I want to target mainpage-iPad.xib to the controller mainpage.m

In IB for the mainpage-iPad.xib I set the class to "mainpage", that seems to be not enough, whenever I run ipad simulator, I always get the view resized as iphone.

Can you point out what I am doing wrong and suggest the proper way to target the xib file to my controllers.

thanks


You can create iPad specific xibs very simple from existing standard iPhone xibs:

  • open iPhone xib in Interface Builder
  • in Menu of Interface Builder select File and Create iPad version (or Create iPad version using Autosizing Masks )
  • save the new iPad xib and add it to your project; the name of iPad xib should be the same as iPhone xib with ~ipad suffix - eg if your iPhone xib is MyViewController.xib your iPad xib should be MyViewController~ipad.xib (use ~ipad instead of -iPad )
  • After that your iPad xibs will be automatically used on iPad. Of course you will also need to upgrade your project to a Universal Application (just like you said).

    链接地址: http://www.djcxy.com/p/95710.html

    上一篇: Xcode 4.2,将iPhone xib更改为iPad xib

    下一篇: 问题与iPad通用的xib文件