Protocol

NSTextFinderClient

A set of methods implemented by objects that support searching using the NSTextFinder class and the in-window text find bar.

Declaration

@protocol NSTextFinderClient

Overview

See NSTextFinder for details.

Topics

String Searching

string

Allows the client to specify a single string for searching.

stringAtIndex:effectiveRange:endsWithSearchBoundary:

Returns the found string that is created by conceptually mapping its content to a single string, which is composed of a concatenation of all its substrings.

stringLength

Returns the full length of the conceptually concatenated string return by the stringAtIndex:effectiveRange:endsWithSearchBoundary: method.

Replacing Text

shouldReplaceCharactersInRanges:withStrings:

Returns whether the specified strings should be replaced.

replaceCharactersInRange:withString:

Replaces the text in the specified range with the new string.

didReplaceCharacters

Specifies whether text characters were replaced.

Selection Information

selectable

Returns whether the text is selectable.

allowsMultipleSelection

Returns whether multiple items can be selected.

firstSelectedRange

Returns the currently selected range.

selectedRanges

Returns an array of selected ranges.

Text Edibility

editable

Returns whether the text is editable.

Determining and Displaying Text Locations

contentViewAtIndex:effectiveCharacterRange:

Returns the view the context is displayed in.

rectsForCharacterRange:

An array containing the located text in the content view’s coordinate system.

scrollRangeToVisible:

Scrolls the specified range such that it is visible.

visibleCharacterRanges

An array of visible character ranges.

Drawing Glyphs

drawCharactersInRange:forContentView:

Draw the glyphs for the requested character range as they are drawn in the given content view.

Relationships

Inherits From

See Also

Search and Replace

NSTextFinder

An optional search-and-replace find interface inside a view, usually a scroll view.

NSTextFinderBarContainer

A protocol that provides a container in which the find bar is displayed.