2

I'm working on a universal app.

Well there's this: Converting iPhone xib to iPad xib? and also this: Xcode 4 .xib Create iPad Version.

Am I the only one that still doesn't manage to convert my nib to iPad? I refresh Xcode and under "size" still only see Retina 3.5 and Retina 4. I even used two of the SO questions scripts attached as answers and still remain with the same iPhone nib...

Please help!

Community
  • 1
  • 1
shaioz
  • 340
  • 3
  • 12
  • Nib sizes are not the big deal, resizing masks or (better) constraints decide the resizing behavior of the in a bigger view. EDIT: or you can decide at runtime to load different xib, one for each device. – Andrea Nov 07 '13 at 15:53
  • I want my nib in the correct size so I can design it to look correct on the ipad, I can't tell how it's gonna look otherwise. loading a different nib at runtime suggestion is not relevant, I'm trying to convert and redesign a complex nib that I have for iPhone, so I need a version of it with iPad dimensions. – shaioz Nov 10 '13 at 10:41
  • "loading a different nib at runtime suggestion is not relevant"... is the most relevant, because by checking the kind of device you can run ipad or iphone xibs. Xibs are just package that contains serialized objects. You can create one xib for iphone and another one for ipad. I'm pretty confident that if you use files identifiers (~ipad,~iphone) the system will run the correct one for you. – Andrea Nov 10 '13 at 12:11
  • Of course, but I already know this. What I don't know is how to create an iPad nib from an existing iPhone nib, so I can design exactly how the VC will look when it loads the ~ipad nib - since I can't set the size to iPad dimensions I have no idea how for example the auto-layout will look. – shaioz Nov 10 '13 at 12:53
  • possible duplicate of [Converting iPhone xib to iPad xib?](http://stackoverflow.com/questions/2488280/converting-iphone-xib-to-ipad-xib) – san Mar 03 '14 at 07:28
  • @san, the accepted solution in that question is no longer possible in Xcode 5 – shaioz Mar 03 '14 at 15:18
  • Yes, Accepted one does not work in XCode5. But one of the others does work. See the answer given by SebastianView. – san Mar 04 '14 at 05:02

2 Answers2

9

I was just having this same problem! I use that answer all the time regarding editing the file in a text editor and it wasn't working. I did a quick compare and the new difference appears to be this:

targetRuntime="iOS.CocoaTouch" 

It's on the second line. It needs to be changed to

targetRuntime="iOS.CocoaTouch.iPad" 

Then you can select the right Size in Interface Builder :o)

StarlitSkies
  • 1,144
  • 7
  • 14
  • 2
    Thank you, i prefer this way for converting xib from iphone to ipad, it is working 100% – TMMDev Jun 12 '14 at 02:44
  • Had a small problem. Some of my xib's didn't have that key-value pair. Apparently my xib was in an old format. Just open it up in interfacebuilder and resave it. It will be converted and the above solution works like a charm. – broch Jul 27 '14 at 16:04
0

If you're using Xcode 6/ iOS8, take a look at size classes for this.

wspruijt
  • 1,037
  • 11
  • 15