I've come back to some old code that I haven't used for a while, and in the 
meantime I've done several OS upgrades and Xcode upgrades so plenty has 
changed, but my code is behaving in a strange way that I'm sure it didn't used 
to.

I have a text field in my GUI bound to a property of type 'double'. The text 
field does not have any explicit number formatter attached to it. When I set 
the property e.g. to 22000 then it appears in the text field as:
22,000
OK, fair enough, maybe the default formatting behaviour of text fields has 
changed. The problem is that when I alter that value (but leaving it in the 
same style), so for example I change it to:
22,001
then the value of my property is set to 22. In other words, the comma is not 
being parsed correctly to treat the whole text string as a number.

This behaviour seems very strange and inconsistent. Is this something that 
people are familiar with? I imagine I could solve this by putting an explicit 
number formatter on every text field, but I have rather a lot of them and so 
would prefer not to do this! I'm also concerned that this is indicative of some 
subtler underlying problem that I should maybe understand rather than hide.

Can anyone advise at all?
Cheers
Jonny.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to