NSTextField sets the maximum characters

Is there an easy way to set the character limit my NSTextField can have? I do not want the counter to then warn the user if he has exceeded the limit, I want to set a limit, so if he skips the x-characters, they can no longer print.

+3
source share
2 answers

Check out NSFormatter. It can help you do what you are looking for and more. If you don’t need something complicated, you can try the NSTextField delegation methods.

+3
source

, . .

, , .

0

Source: https://habr.com/ru/post/1719134/


All Articles