Instance Method

handleTextCheckingResults:forRange:types:options:orthography:wordCount:

Handles the text checking results returned by the text view

Declaration

- (void)handleTextCheckingResults:(NSArray<NSTextCheckingResult *> *)results forRange:(NSRange)range types:(NSTextCheckingTypes)checkingTypes options:(NSDictionary<NSTextCheckingOptionKey, id> *)options orthography:(NSOrthography *)orthography wordCount:(NSInteger)wordCount;

Parameters

results

An array of NSTextCheckingResult objects.

range

The range of text that was checked.

checkingTypes

The type of checking performed. The possible constants are listed in NSTextCheckingTypes and can be combined using the C bit-wise OR operator to perform multiple checks at the same time.

options

The dictionary of values used during the checking process to perform. See Spell Checking Option Dictionary Keys for the supported values.

orthography

The orthography of the checked text.

wordCount

The number of words.

Discussion

The NSTextViewDelegate offers a method, textView:didCheckTextInRange:types:options:results:orthography:wordCount: that is called after the checking is performed, allowing you to modify the results.

This method usually would not be called directly, since NSTextView itself will call it as needed, but it can be overridden.

See Also

Text Checking and Substitutions

- checkTextInDocument:

Performs the default text checking on the entire document.

- checkTextInSelection:

Performs the default text checking on the current selection.

- checkTextInRange:types:options:

Check and replace the text in the range using the specified checking types and options.

enabledTextCheckingTypes

The default text checking types.

automaticDashSubstitutionEnabled

A Boolean value that indicates whether automatic dash substitution is enabled.

- toggleAutomaticDashSubstitution:

Toggles the state of the automatic dash substitution.

automaticDataDetectionEnabled

A Boolean value that indicates whether automatic data detection is enabled.

- toggleAutomaticDataDetection:

Toggles the state of the automatic data detection.

automaticSpellingCorrectionEnabled

A Boolean value that indicates whether automatic spelling correction is enabled.

- toggleAutomaticSpellingCorrection:

Toggles the state of the automatic spelling correction.

automaticTextReplacementEnabled

A Boolean value that indicates whether automatic text replacement is enabled.

- toggleAutomaticTextReplacement:

Toggles the state of the automatic text replacement.