Instance Property


The selection granularity for subsequent extension of a selection.


@property NSSelectionGranularity selectionGranularity;


Selection granularity is used to determine how the selection is modified when the user Shift-clicks or drags the mouse after a double or triple click. For example, if the user selects a word by double-clicking, the selection granularity is set to NSSelectByWord. Subsequent Shift-clicks then extend the selection by words.

Selection granularity is reset to NSSelectByCharacter whenever the selection is set. You should always set the selection granularity after setting the selection.

See Also

Managing the Selection


An array containing the ranges of characters selected in the receiver’s layout manager.

- setSelectedRange:

Sets the selection to the characters in an array of ranges.

- setSelectedRange:affinity:stillSelecting:

Sets the selection to a range of characters in response to user action.

- setSelectedRanges:affinity:stillSelecting:

Sets the selection to the characters in an array of ranges in response to user action.


The preferred direction of selection.


The color of the insertion point.

- updateInsertionPointStateAndRestartTimer:

Updates the insertion point’s location and optionally restarts the blinking cursor timer.


The attributes used to indicate the selection.


The attributes used to draw marked text.


The attributes used to draw the onscreen presentation of link text.

- characterIndexForInsertionAtPoint:

Returns a character index appropriate for placing a zero-length selection for an insertion point associated with the mouse at the given point.