Although one may use NSNumberFormatter to achieve a similar result - what I don’t like about about that solution is this:
If a user types non-numeric characters into the NSTextField and attempts to tab away from the field, they get the default error sound and their tab attempt is denied.
To me this isn’t user friendly.
More to come - for now see this blog post: Subclassing NSTextField to Allow Only Numbers.
- add an extended example limiting range