"final" string validation in custom NSFormatter
"final" string validation in custom NSFormatter
- Subject: "final" string validation in custom NSFormatter
- From: Mark Dawson <email@hidden>
- Date: Fri, 10 Dec 2004 10:48:28 -0800
When writing a custom formatter, how do I do a "final" string validation? I've overriden "
isPartialStringValid", which works fine, up to a point.
In my case, I allow fractions. So the user typing in "1/" is valid to that point. However, if they try to commit that (pressing the enter key, tabbing, exiting out, etc) the string is now INVALID (i.e., you need a denominator).
<x-tad-bigger>I assume there should be some test in </x-tad-bigger>getObjectValue for "exit key", returning an error (not allowing the user to exit) if the final keys are not valid, and a similar test in <x-tad-bigger>stringForObjectValue that would not cause a reformat until the text field was committed & validated (i.e., I might allow fractional input, but want only decimal output, 1/2 --> 0.5).
</x-tad-bigger>
Thanks for any insight!
mark
email@hidden _______________________________________________
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