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)aStringThis method is the means by which text typed by the user enters an
NSTextView. See theNSInputManagerclass andNSTextInputprotocol specifications for more information. ...
In NSTextInput there is a note:
IMPORTANT
NSTextInputprotocol is slated for deprecation. Please useNSTextInputClientprotocol, 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