2
votes

While developing an application, I am asked to remove multi-line text inputs from NSTextField - Which I did.

Again they said users are able to paste multiline texts, then I disabled +V.

From here... I have a confusion... Why NSTextField allows opt + Enter and other key shortcuts (like hacking) to insert a new line character. I read somewhere that it is a feature not a bug, but I am unable to find that link.

Is the above correct, and is it mentioned any where in Apple Documentation?

2
What is your current solution for blocking multline text?Hampus Nilsson
@HampusNilsson: you can find dozen of answers...in SOAnoop Vaidya
Yes there are many answers already. I'd like to help you but you could delimit the work of finding a method that works by saying which methods do not work. :)Hampus Nilsson
@HampusNilsson: I am not asking for any codes. My question is "Is ctrl+enter a bug or feature as it inserts a new line." If it is a feature then is it documented somewhere so that I can give reference.Anoop Vaidya

2 Answers

1
votes

This behavior is documented (or at least mentioned as a feature of NSTextField) here in the Mac developer library: https://developer.apple.com/library/mac/qa/qa1454/_index.html

1
votes

Here's another doc reference: Working with the Field Editor. Specifically, it says "Users can easily put newline characters into a text field by pressing Option-Return or Option-Enter."