• 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
Validating the input into a NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Validating the input into a NSTextField


  • Subject: Validating the input into a NSTextField
  • From: email@hidden (Ralf Hasemann)
  • Date: Sun, 23 Feb 2003 21:23:12 +0100

Hi!

the application I am writing needs detailed control over the input in a NSTextField.
The best would be, if I can validate every keystroke the user enters.
I investigated the API of NSTextView a little bit and found it surprisingly complicated
to implement such a function.

The only thing I want to do is to limit the max. length of the input into a NSTextfield to <n> characters
and to make shure that only a specific range of characters can be entered (0 to 9 and A to F for example).

If there a simple way to implement such a feature instead of using NSControl delegates like:

- control:textShouldBeginEditing:
- control:textShouldEndEditing:
- controlTextDidBeginEditing:
- controlTextDidChange:
- controlTextDidEndEditing:

because it gets really tricky to implement such a simple thing with the availavle delegate methods.

Regards,
Ralf
------------------------------------------------------
Ralf Hasemann
eMail: email@hidden
Web: www.osxdeveloper.de

An Apple a day keeps the doctor away!
------------------------------------------------------
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Validating the input into a NSTextField
      • From: Scott Anguish <email@hidden>
  • Prev by Date: Multiple seperator lines in window menu
  • Next by Date: Re: Validating the input into a NSTextField
  • Previous by thread: Multiple seperator lines in window menu
  • Next by thread: Re: Validating the input into a NSTextField
  • Index(es):
    • Date
    • Thread