Instance Method

hasMarkedText

Returns a Boolean value indicating whether the receiver has marked text.

Required.

Declaration

- (BOOL)hasMarkedText;

Return Value

YES if the receiver has marked text; otherwise NO.

Discussion

The text view itself may call this method to determine whether there currently is marked text. NSTextView, for example, disables the Edit > Copy menu item when this method returns YES.

See Also

Handling Marked Text

- markedRange

Returns the range of the marked text.

Required.

- selectedRange

Returns the range of selected text.

Required.

- setMarkedText:selectedRange:replacementRange:

Replaces a specified range in the receiver’s text storage with the given string and sets the selection.

Required.

- unmarkText

Unmarks the marked text.

Required.

- validAttributesForMarkedText

Returns an array of attribute names recognized by the receiver.

Required.