Advice on formatters
Advice on formatters
- Subject: Advice on formatters
- From: Mike Abdullah <email@hidden>
- Date: Sat, 21 Jan 2006 00:55:42 +0000
I'm after some advice on using formatters in my interface. To start
with, I've simply set up my interface so that it has a few text
fields (with NSNumberFormatters attached) and button for the user to
click.
Whilst the formatter does seem to do it's job on the whole, I have a
couple of issues with it and would quite like to know what the best
way of solving them would be.
1. The text field still allows the entering of non-numeric
characters. Personally, I would like for the text field to simply
ignore everything but numeric characters. However, this is not
actually essential as such, but the current behaviour does lead to:
2. The user can click the button in the window whilst one of the text
fields has a non-numeric character. As far as I can make out, the
reading taken from the text field when this happens is the last valid
string the user entered (this is good), but the text field doesn't
revert to this string in appearance (which is bad, since it seems
kind of confusing to the user).
So, what should I do about this? Should I subclass NSNumberFormatter
for the behaviour I want, and if so, how? Or should, I create my own
formatter from scratch?
Mike.
_______________________________________________
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