Re: invalid formatter values
Re: invalid formatter values
- Subject: Re: invalid formatter values
- From: Keary Suska <email@hidden>
- Date: Thu, 15 Nov 2007 14:27:06 -0700
- Thread-topic: invalid formatter values
on 11/13/07 9:35 PM, email@hidden purportedly said:
> I have a number formatter on a text field to reject values less than
> zero. I want to make it so that it will revert the value to the
> pervious value and not call the action function for invalid values. I
> have control:didFailToFormatString:errorDescription: return NO, but
> the action function is still called. Is there a way to not call it
> when the value is invalid, and is there a straight-forward way to set
> the field to the previous, valid value?
It would likely be easier to use a custom formatter that disallows entering
a dash (minus sign). Then the numbers entered will always have to be
positive.
My philosophy has been--and I believe it is consistent with HIG--that it is
better to not let the user do something than it is to let them do something
wrong and them tell them so, or, in your case, beep and revert the value.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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