The Ultimate Business Machine - Archives
List of Categories : Commentary * Database * Singapore * Technology * Travel *
Wed 08 Aug 2012
More Mountain Lion Differences
Category : Technology/NSTextFieldsInMountainLion.txt
has been hit by another stealth change Apple made to Mountain Lion.
NSTextFields in Mountain Lion now appear to have auto-formatting turned on (which is not the case with previous versions of OS X). In other words, when a number value is entered into a text field, the text field will automatically format its appearance according to the number display format the user had chosen in System Preferences.
For example if 2012 is entered into a text field, NSTextField will automatically format it as 2,012, as shown below.
If you entered "abcd" into the text field, that will of course be displayed as "abcd". All very convenient. But if 2012 stands for the year we want to capture data for, then displaying it as 2,012 looks rather odd. Worse, when we take the value back as a string value and use it to compare against another string value like "2012", we find we're comparing "2,012" against "2012", thus throwing a lot of the embedded (and assumed) programming logic out of whack.
So, in Mountain Lion, we've had to go through a lot of our code to clean up stuff like that. There may be more lurking that we have not yet spotted. So let us know as soon as you see something that isn't working as it should.