6

I am trying to disable editing in NSTextView but there doesn't seem to be any option there.All the other types have enabled property which when set to false are non editable but is there any for NSTextView?

Zeist
  • 635
  • 1
  • 7
  • 17

2 Answers2

5

Please do not forget that a class inherits the methods of its superClass. The superClass of NSTextView is NSText. And there you find the method

  • (void)setEditable:(BOOL)flag

with the comment:

Controls whether the receiver allows the user to edit its text.
Heinrich Giesen
  • 501
  • 1
  • 3
  • 11
1

For SWIFT3, you need to set isEditable to false.

var isEditable: Bool A Boolean value that controls whether the text views sharing the receiver’s layout manager allow the user to edit text.

https://developer.apple.com/documentation/appkit/nstextview#overview

Ham Dong Kyun
  • 756
  • 4
  • 28