Contents

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 NSString or an NSAttributedString object; must not be nil.

  • selRange:

    The range within aString to 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.

See Also

Deprecated methods