Re: NSTextField allowing only numbers
Re: NSTextField allowing only numbers
- Subject: Re: NSTextField allowing only numbers
- From: Daniel Todd Currie <email@hidden>
- Date: Sat, 23 Oct 2004 11:20:35 +0900
Check the docs for NSFormatter.
On 2004 Oct 23, at 04:41, Michael Becker wrote:
Hello all!
I have an NSTextField and I want it to only accept numbers as input.
If the user tries to enter any other character than a digit, nothing
should happen.
But somehow I cannot find the right way to do that.
I've tried -controlTextDidChange:, this way I can tell whether the
user entered an unwanted character, but I cannot prevent them from
doing so.
And -control:textShouldBeginEditing: is only called for the first
character the user inputs, so this doesn't work either.
How do I go about this?
Bye,
Michael
_______________________________________________
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
_______________________________________________
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