0

I use the xcode 4.2 duplicate target feature to create iPad target, which also created Resources-iPad folder with all the iPad xib files.

Now I have two Targets:

  • myApp
  • myApp-iPad

two Resources:

  • Resources
  • Resources-iPad

I also set myApp project file setting:

 Targeted Device Family - iPhone/iPad

Question: When I run the app targeted to iPad simulator it uses iPhone resources files. Am I missing any settings to use the iPad resource?

HardCode
  • 2,025
  • 4
  • 33
  • 55

1 Answers1

3

enter image description hereIf I understand correctly what you did, you did not converted your target to a Universal app; rather, you created a new iPad-only version of your target.

What you want is way easier: click on your target and then use the 'Targeted Device Family' drag-down menu to choose "iPhone/iPad".

In Interface Builder you will find a corresponding command to convert the xib, but it seems that this has been already done for your when creating the iPad target.

Hope this helps.

EDIT:

If your xib file for the iPhone is called "MainWindow.xib", you should provide a xib file for the iPad named "MainWindow-iPad.xib". This way, it will be used instead of former when the app is running on an iPad device.

You should also ensure that the iPad xib is present in the "Copy Bundle Resources" section under the "Build Phases" tab of your target.

sergio
  • 68,819
  • 11
  • 102
  • 123
  • I'm sorry I don't find 'Devices'. Could you please locate where it is? – HardCode May 02 '12 at 16:03
  • Ok, it worked but, still not using the Resources-iPad xib files. It's actually resizing the iPhone xib files. – HardCode May 02 '12 at 16:15
  • Check if the "*-ipad" xib files has been added to the universal target (the way you created it, it belong to the iPad specific target). – sergio May 02 '12 at 16:17
  • I don't know what do you mean by universal target xib file. But I check the ipad resource xib sorcecode and I found . By the way both iphone and ipad xib files are same name. – HardCode May 02 '12 at 16:27
  • Thank you for the answer. I don't see my ipad xib files under copy bundle resources. How do I add the the files? – HardCode May 02 '12 at 18:20
  • simply drag it from the file list on the left to the copy bundle resource section... – sergio May 02 '12 at 18:43
  • It works! One little thing when you name the iPad xib file, you should name "*~iPad.xib". Thank you for your help and patients. – HardCode May 02 '12 at 18:58