Does anyone know how to limit type of characters that can be entered into an NSTextField?. I have a special situation where only some of the characters from the alphabet should be entered. For example, only a-zA-Z0-9+_- should be allowed. Also, how to trim spaces at the beginning and the end of the string entered into NSTextField. It's easy by regex but what I really like is catch them at the moment when they are entered and refuse. Cheers, F.