在 NSTextView 中禁用编辑

Zei*_*ist 5 macos cocoa nstextview

我试图在 NSTextView 中禁用编辑,但那里似乎没有任何选项。所有其他类型都启用了属性,当设置为 false 时不可编辑,但 NSTextView 有没有?

小智 5

请不要忘记类继承其超类的方法。的超类NSTextViewNSText. 在那里你可以找到方法

  • (void)setEditable:(BOOL)标志

与评论:

Controls whether the receiver allows the user to edit its text.
Run Code Online (Sandbox Code Playgroud)