Validating the input into a NSTextField
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.