NSNumberFormatter question - showing mixed state
NSNumberFormatter question - showing mixed state
- Subject: NSNumberFormatter question - showing mixed state
- From: Graham Cox <email@hidden>
- Date: Fri, 22 Jan 2010 15:06:48 +1100
I have text fields which use NSNumberFormatters that occasionally need to show a mixed value.
My preferred design is that when they contain a mixed value, they show '--'. My problem is that I can't seem to get the formatters to return this string. For example, the formatter has the 'nil symbol' and 'NaN symbol' set to this, but calling [textField setObjectValue:nil] doesn't display it. If I try and directly set the field's string using [textField setStringValue:@"--"] the formatter converts this to 0.
I've tried subclassing the formatter and directly attempting to detect nil or [NSNull null] as the object value but it never works, because the object passed is always an NSNumber with value 0 even if the field is set with a string or nil.
Any ideas how I can achieve what I want here?
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden