• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSNumberFormatter question - showing mixed state
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSNumberFormatter question - showing mixed state
      • From: "email@hidden" <email@hidden>
  • Prev by Date: Re: Uploading image via HTTP POST
  • Next by Date: Re: NSTabViewDelegate
  • Previous by thread: Re: NSTabViewDelegate
  • Next by thread: Re: NSNumberFormatter question - showing mixed state
  • Index(es):
    • Date
    • Thread