Xcode 4 .xib Create iPad Version

前端 未结 9 2390
醉梦人生
醉梦人生 2020-12-01 01:28

I have an iPhone xib I want to turn into an iPad xib. In Xcode 3 there was a \"Create iPad Version\" menu option. How do I do this in Xcode 4?

I currently resized m

9条回答
  •  不知归路
    2020-12-01 02:10

    On assessing my options, these were my thoughts:

    • Too much of a hassle to install xcode 3 and downgrade project
    • Don't want to mess with .xib file format - afraid it might break something that will show itself much later
    • Copying the same nib is imperfect (see the explanations in this thread)

    So finally, what I ended up doing that works fine is:

    1. Create a new file, choose "UIViewController derived" class
    2. Check the "intended for iPad" checkbox
    3. Name the file -iPad
    4. Delete the .h and .m corresponding to the uiviewcontroller
    5. Now populate the new nib with the same objects, structure and connections as the original nib
    6. Check if on iPad, if so then load the new nib else load the old nib

提交回复
热议问题