Xcode Should Honor Deployment Target When Creating XIBs

Originator:paulo.fierro
Number:rdar://13694102 Date Originated:26-Apr-2013
Status:Closed Resolved:NO
Product:Xcode Product Version:4
Classification: Reproducible:YES
 
Summary: I have an Xcode project that builds an iOS app. The Deployment Target for the project is set to "5.0". When I create a new XIB file, the Use Auto Layout checkbox defaults to On, but Auto Layout is not supported in iOS 5.0.

It would be nice if Xcode would automatically disable autolayout for pre-iOS 6 deployment targets. It would also be nice if the Document Version Deployment field defaulted to "iOS 5.0" rather than to "Project SDK (iOS 6.1)".

As-is, I have to remember to fiddle with these settings each time I create a new XIB, or the app won't run on iOS 5.


Steps to Reproduce:

1. Create a new Xcode iOS project. Set the Deployment Target to 5.0.
2. Choose File > New > File... > New...
3. Choose a template that will create a XIB. For example: User Interface > View
4. Give the new file a name and save it.
5. In the Project Navigator, select the new file. Open the File Inspector in the Utilities panel, and look at the Interface Builder Document section. Note that Use Autolayout is checked, and Document Version: Deployment has "Project SDK (iOS 6.1) selected.

Expected Results:

Xcode should not create files with attributes that are incompatible with the project's deployment target by default. It should automatically set the attributes to be compatible with the deployment target, or prompt the user to determine what is desired.


Actual Results:

Xcode creates XIBs targeted at the current SDK version, regardless of deployment target setting.


Regression: N/A

Notes: N/A

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!