• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTextField allowing only numbers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTextField allowing only numbers


  • Subject: NSTextField allowing only numbers
  • From: Michael Becker <email@hidden>
  • Date: Fri, 22 Oct 2004 21:41:04 +0200

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
  • Follow-Ups:
    • Re: NSTextField allowing only numbers
      • From: Daniel Todd Currie <email@hidden>
  • Prev by Date: Re: Tall NSTableView Column Headers
  • Next by Date: Creating a Custom Formatter
  • Previous by thread: Re: Comment field in file info.
  • Next by thread: Re: NSTextField allowing only numbers
  • Index(es):
    • Date
    • Thread