Autoshrink Flag of a UILabel is ignored when a nib is created via ibtool

Originator:vp
Number:rdar://10984259 Date Originated:05-Mar-2012 05:41 PM
Status:Open Resolved:
Product:Developer Tools Product Version:4.3
Classification:Serious Bug Reproducible:YES
 
Summary:

In order to manage translations of Interface Builder nib files, we keep one version in the original language (usually english) and generate the other languages through strings files via the command line tool "ibtool".
To keep the nibs in sync, the build script is executed on every run.

If the nib contains a UILabel, ibtool omits the "autoshrink" flag, which was introduced in XCode 4.3. As a result, nibs in derived languages have a wrong layout and are truncated (instead of shrunk).


Steps to Reproduce:
1. In XCode 4.3, create a project from the iOS "a single window" template.

2. Go into the project's default language folder (usually "en.jproj") and open the default ViewController.nib

3. Add a UILabel into the mentioned nib file and enable the autoshrink flag in the "Label" section within the "Attributes Inspector".

4. Save.

5. Extract the strings with the ibtool:
ibtool --generate-strings-file vc.strings ViewController.xib

6. Regenerate a new nib file from the strings file and the original nib:
ibtool --strings-file vc.strings --write newNib.xib ViewController.xib


Expected Results:
New generated file should have a label, where autoshrink is enabled.

Actual Results:
Generated nib contains the label, but the autoshrink flag is disabled. Therefore the presentation is wrong (truncated on longer text, instead of shrunk).

Regression:

Notes:

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!