Submitted this radar to Apple a couple of weeks ago.

Steps to Reproduce:

1. Create a new single view application without using storyboards.
2. Change the minimum deployment target to iOS 5 or 5.1
3. Add a new view controller by selecting the “With XIB for user interface” option checked.
4. Create a button on your main view and link the button’s touch up inside action to a IBAction that presents the new view controller modally.
Build and run the app on a iOS 5 device.

Expected Results:

The app should run without crashing

Actual Results:

The app crashes when you tap the button to present the modal view on iOS 5 device as NSLayout* classes are available only on iOS 6 and higher OSes.

Regression:

Step 3 creates the new XIB with Auto Layout checked by default. But iOS 5 and prior OSes don’t support and don’t have classes in the framework to support Auto Layout.

Notes:

Xcode should create a XIB without Use Auto Layout checked when the deployment target doesn’t support it.

Xcode’s ARC migration wizard does this properly. When my deployment target is iOS 4, it uses unsafe_unretained instead of weak.

BTW, if you are planning to support iOS 5, Auto Layout is not for you.

I’m not sure if this is a bug, or an expected behaviour. The documentation doesn’t explain it either. If you think this behaviour is wrong/unexpected, duplicate radar://12235700

Mugunth

Follow me on Twitter