setMarkedText:selectedRange:
Replaces currently marked text in the receiver’s text storage with the given string and sets the selection to the given range, computed from the beginning of the marked text.
Declaration
- (void) setMarkedText:(id) string selectedRange:(NSRange) selRange;Parameters
- string:
Either an
NSStringor anNSAttributedStringobject; must not benil. - selRange:
The range within
aStringto set as the selection.
Discussion
If there is no marked text, the current selection is replaced. If there is no selection, the string is inserted at the insertion point.