I want to disallow entering a new-line character in my NSTextField, which by default is possible by typing Option-Enter (or Option-Return).
While I found some pages explaining how to allow line breaks without having to use the Option modifier, I couldn't find anything for disabling line breaks altogether.
How can this be done?
You could create a subclass of NSFormatter and implement the isPartialStringValid:... method to block the newline.