NSNumberFormatter forbidding non-digits?
NSNumberFormatter forbidding non-digits?
- Subject: NSNumberFormatter forbidding non-digits?
- From: "Paul J. Lucas" <email@hidden>
- Date: Tue, 8 Nov 2005 21:08:15 -0800 (PST)
I have an NSTextField with an attached NSNumberFormatter.
Actually, the class is derived from NSNumberFormatter. It
overrides isPartialStringValid to trap keystrokes as the user
types them. The first thing I do is to call super's
isPartialStringValid. If the returns false, I do nothing more.
I would have expected it to return false if the user types a
non-digit to disallow entering of non-digits (and beep). But it
allows non-digits. (I do a setFormat:@"0" on the formatter.)
Why doesn't my formatter reject non-digits? How can I make it
reject nondigits short of checking for it myself? (I thought
that's the point of using a NSNumberFormatter so you don't have
to check for non-digits yourself.)
- Paul
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden