10.4-Style NSNumberFormatter created in IB ignore current locale

Originator:ilja
Number:rdar://15813276 Date Originated:14-Jan-2014
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification:Serious Bug Reproducible:Always
 
Summary:
When attaching an NSNumberFormatter using OS X 10.4 default behavior to an NSTextField, the number formatter will ignore the users current locale on run time, regardless of the value of the localize checkbox in IB. Instead it is always using the locale that was active when the number formatter was created in IB.

Side-Bug: In IB, the localize checkbox shouldn't be available, or its tooltip is misleading. The tooltip says the checkbox is related to setLocalizesFormat:, which according to the documentation has no effect for 10.4-style formatters.

Steps to Reproduce:
1. Create a new OS X Cocoa Application in Xcode
2. Select Main Menu.xib
3. Create an NSTextField
4. Drag a new instance of NSNumberFormatter to the text field
5. Set the number formatter to use 10.4 default behavior, scientific style
6. Create an property in the ApplicationDelegate, connect it to the NSTexfield via a binding. Check updates continuously and validates immediately options for binding.
7. Run the application, enter something like 4.05 into the field, everything fine
8. quit app, change system locale to German
9. Run the application again, enter 4,05 into the text field, error pops up

Expected Results:
In Step 9, the "," should be accepted as current number formatter and not throw an error

Actual Results:
NSNumberFormatter chocks on the German decimal separator and throws an error.

Version:
OS X 10.9.1 
Xcode 5.0.2

Notes:
See problem discussion on stack overflow:
http://stackoverflow.com/questions/21110740/why-does-an-10-4-style-nsnumberformatter-not-auto-localize-decimal-separator

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!