10

A question here: Xcode 4.5 corrupting XIBs? illustrates the problem and solution for xcode 4.5 creating nib files that can not run on ios5.

Does anyone have a solution to prevent the auto layout checkbox from being defaulted to on? I'm worried that in the process of development, I will forget to unchecked that box.

enter image description here

Community
  • 1
  • 1
Mike
  • 894
  • 12
  • 19

2 Answers2

13

There's a way, but it's kinda convoluted and, I might add, not recommended.

You can open your template files located in:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/User Interface/, in each directory, there are .xib files. They are XML files, open them with a text editor.

Replace the following line:

<bool key="IBDocument.UseAutolayout">YES</bool>

to

<bool key="IBDocument.UseAutolayout">NO</bool>

I will repeat though, this is not recommended.

Simon Germain
  • 6,834
  • 1
  • 27
  • 42
  • That is interesting. Is it not recommended because it will get overridden during upgrades? Or because it will not get overridden during upgrades? Or some other reason? – Mike Oct 04 '12 at 01:46
  • 1
    Since autolayouts crashes on apps running under iOS 5.0 (which I have to support) it is worth it to me to do this. Thank you for the answer! – software evolved Jan 23 '13 at 16:07
0

There is a project templates folder, you should modify the xib files there too.

Also if you want to disable auto layout in storyboards, you should change this attribute:

useAutolayout="YES"

in each storyboard file to NO.

Tibor Bödecs
  • 381
  • 2
  • 9