I saw in the AppKit API Reference that the insertText
method is deprecated in OS X v10.11. What am I supposed to use as a replacement?
The documentation says
- (void)insertText:(id)aString
This method is the means by which text typed by the user enters an
NSTextView
. See theNSInputManager
class andNSTextInput
protocol specifications for more information. ...
In NSTextInput
there is a note:
IMPORTANT
NSTextInput
protocol is slated for deprecation. Please useNSTextInputClient
protocol, introduced in OS X v10.5, as described inNSTextInputClient Protocol Reference
.
In NSTextInputClient
protocol there is a method
- (void)insertText:(id)aString
replacementRange:(NSRange)replacementRange
This seems to be the appropriate replacement
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With