Making NSTextField REALLY single line

One thing i hate of the NSTextField is that while you can’t use the “enter” key to insert newlines characters you still can insert them, for example, by copying in them text which contains newlines characters. This is plain annoying sometimes! I made this NSFormatter that can be attached to an NSTextField and will just strip the newlines found in input, so if you paste multiple lines they will all be merged on a single line.

Download the BRSingleLineFormatter Class

One Response to “Making NSTextField REALLY single line”

  1. Karsten Says:

    lol…cool thing, i think i can include that in my apps somewhere 😀

    thx for sharing 😉