NSSpellChecker Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.0 and later. |
| Companion guide | |
| Declared in | NSSpellChecker.h |
Overview
The NSSpellChecker class provides an interface to the Cocoa spell-checking service. To handle all its spell checking, an application needs only one instance of NSSpellChecker, known as the spell checker. Through the spell checker you manage the Spelling panel, in which the user can specify decisions about words that are suspect.
The spell checker also offers the ability to provide word completions to augment the text completion system in OS X v10.3.
Tasks
Getting the Spell Checker
Configuring Spell Checkers Languages
-
– availableLanguages -
– userPreferredLanguages -
– automaticallyIdentifiesLanguages -
– setAutomaticallyIdentifiesLanguages: -
– language -
– setLanguage:
Managing Panels
-
– spellingPanel -
– substitutionsPanel -
– updateSpellingPanelWithGrammarString:detail: -
– updatePanels -
– accessoryView -
– setAccessoryView: -
– substitutionsPanelAccessoryViewController -
– setSubstitutionsPanelAccessoryViewController:
Checking Strings for Spelling and Grammar
-
– countWordsInString:language: -
– checkSpellingOfString:startingAt: -
– checkSpellingOfString:startingAt:language:wrap:inSpellDocumentWithTag:wordCount: -
– checkGrammarOfString:startingAt:language:wrap:inSpellDocumentWithTag:details: -
– checkString:range:types:options:inSpellDocumentWithTag:orthography:wordCount: -
– requestCheckingOfString:range:types:options:inSpellDocumentWithTag:completionHandler: -
– guessesForWordRange:inString:language:inSpellDocumentWithTag: -
– guessesForWord:Deprecated in OS X v10.6
Managing the Spell-Checking Process
-
+ uniqueSpellDocumentTag -
– closeSpellDocumentWithTag: -
– ignoreWord:inSpellDocumentWithTag: -
– ignoredWordsInSpellDocumentWithTag: -
– setIgnoredWords:inSpellDocumentWithTag: -
– setWordFieldStringValue: -
– updateSpellingPanelWithMisspelledWord: -
– completionsForPartialWordRange:inString:language:inSpellDocumentWithTag: -
– hasLearnedWord: -
– unlearnWord: -
– learnWord: -
– userQuotesArrayForLanguage: -
– userReplacementsDictionary -
– forgetWord:Deprecated in OS X v10.5
Data Detector Interaction
Automatic Spelling Correction
-
– correctionForWordRange:inString:language:inSpellDocumentWithTag: -
+ isAutomaticSpellingCorrectionEnabled -
– showCorrectionIndicatorOfType:primaryString:alternativeStrings:forStringInRect:view:completionHandler: -
– recordResponse:toCorrection:forWord:language:inSpellDocumentWithTag: -
– dismissCorrectionIndicatorForView:
Automatic Text Replacement
Class Methods
isAutomaticSpellingCorrectionEnabled
Returns whether automatic spelling correction is enabled.
Return Value
Returns YES if automatic spelling correction is enabled; NO otherwise.
Availability
- Available in OS X v10.7 and later.
Declared In
NSSpellChecker.hisAutomaticTextReplacementEnabled
Returns whether automatic spelling replacement is enabled.
Return Value
Returns YES if automatic spelling correction is enabled; NO otherwise.
Availability
- Available in OS X v10.7 and later.
Declared In
NSSpellChecker.hsharedSpellChecker
Returns the NSSpellChecker (one per application).
Return Value
The spelling checker shared by this application.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSSpellChecker.hsharedSpellCheckerExists
Returns whether the application’s NSSpellChecker has already been created.
Return Value
YES if the shared spell checker already exists, otherwise NO.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSSpellChecker.huniqueSpellDocumentTag
Returns a guaranteed unique tag to use as the spell-document tag for a document.
Return Value
Returns a unique tag to identified this spell checked object.
Discussion
Use this method to generate tags to avoid collisions with other objects that can be spell checked.
Availability
- Available in OS X v10.0 and later.
Declared In
NSSpellChecker.hInstance Methods
accessoryView
Returns the Spelling panel’s accessory view.
Return Value
The accessory view or nil if there is none.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSSpellChecker.hautomaticallyIdentifiesLanguages
Returns whether the spell checker will automatically identify languages.
Return Value
YES if languages are automatically identified, otherwise NO.
Availability
- Available in OS X v10.6 and later.
Declared In
NSSpellChecker.havailableLanguages
Provides a list of all available languages.
Return Value
An array containing all the available spell checking languages. The languages are ordered in the user’s preferred order as set in the system preferences.
Discussion
If automaticallyIdentifiesLanguages is YES, then text checking will automatically use this method as appropriate; otherwise, it will use the language set by setLanguage:.
The older checkSpellingOfString:startingAt:language:wrap:inSpellDocumentWithTag:wordCount: and checkGrammarOfString:startingAt:language:wrap:inSpellDocumentWithTag:details:. methods will use the language set by setLanguage:, if they are called with a nil language argument.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSSpellChecker.hcheckGrammarOfString:startingAt:language:wrap:inSpellDocumentWithTag:details:
Initiates a grammatical analysis of a given string.
Parameters
- string
String to analyze.
- start
Location within string at which to start the analysis.
- language
Language use in string. When
nil, the language selected in the Spelling panel is used.- wrap
YESto specify that the analysis continue to the beginning of string when the end is reached.NOto have the analysis stop at the end of string.- documentTag
An identifier unique within the application used to inform the spell checker which document that text is associated, potentially for many purposes, not necessarily just for ignored words. A value of 0 can be passed in for text not associated with a particular document.
- outDetails
On output, dictionaries describing grammar-analysis details within the flagged grammatical unit. See the
NSSpellServerclass for information about these dictionaries.
Return Value
Location of the first flagged grammatical unit.
Availability
- Available in OS X v10.5 and later.
Declared In
NSSpellChecker.hcheckSpellingOfString:startingAt:
Starts the search for a misspelled word in stringToCheck starting at startingOffset within the string object.
Parameters
- stringToCheck
The string to spell check.
- startingOffset
The offset at which to start checking.
Return Value
Returns the range of the first misspelled word.
Discussion
Wrapping occurs, but no ignored-words dictionary is used.
Availability
- Available in OS X v10.0 and later.
Declared In
NSSpellChecker.hcheckSpellingOfString:startingAt:language:wrap:inSpellDocumentWithTag:wordCount:
Starts the search for a misspelled word in a string starting at specified offset within the string.
Parameters
- stringToCheck
The string object containing the words to spellcheck.
- startingOffset
The offset within stringToCheck at which to begin spellchecking.
- language
The language of the words in the string. If language is
nil, or if you obtain the value by sendinglanguagetoself, the current selection in the Spelling panel’s pop-up menu is used. Do not pass in an empty string for language.- wrapFlag
YESto indicate that spell checking should continue at the beginning of the string when the end of the string is reached;NOto indicate that spellchecking should stop at the end of the document.- tag
An identifier unique within the application used to inform the spell checker which document that text is associated, potentially for many purposes, not necessarily just for ignored words. A value of 0 can be passed in for text not associated with a particular document.
- wordCount
Returns by indirection a count of the words spell-checked up to and including the first error (if any), or -1 if the spell checker fails or does not support word counting. Specify
NULLif you do not want this word count.
Return Value
The range of the first misspelled word and optionally (and by reference) the count of words spellchecked in the string in wordCount.
Availability
- Available in OS X v10.0 and later.
Declared In
NSSpellChecker.hcheckString:range:types:options:inSpellDocumentWithTag:orthography:wordCount:
Requests unified text checking for the given range of the given string.
Parameters
- stringToCheck
The string to check.
- range
The range of the string to check.
- checkingTypes
The type of checking to be performed. The possible constants are listed in
NSTextCheckingTypeand can be combined using the C bit-wiseORoperator to perform multiple checks at the same time.- options
The options dictionary specifying the types of checking to perform. See “Spell Checking Option Dictionary Keys” for the possible keys and expected values.
- tag
An identifier unique within the application used to inform the spell checker which document that text is associated, potentially for many purposes, not necessarily just for ignored words. A value of 0 can be passed in for text not associated with a particular document.
- orthography
Returns by-reference, the orthography of the range of the string. See
NSOrthographyfor more information.- wordCount
Returns by-reference, the word count for the range of the string.
Return Value
An array of NSTextCheckingResult objects describing particular items found during checking and their individual ranges, sorted by range origin, then range end, then result type.
Availability
- Available in OS X v10.6 and later.
Declared In
NSSpellChecker.hcloseSpellDocumentWithTag:
Notifies the receiver that the user has finished with the tagged document.
Discussion
The spell checker will release any resources associated with the document, including but not necessarily limited to, ignored words.
Availability
- Available in OS X v10.0 and later.
Declared In
NSSpellChecker.hcompletionsForPartialWordRange:inString:language:inSpellDocumentWithTag:
Provides a list of complete words that the user might be trying to type based on a partial word in a given string.
Parameters
- partialWordRange
Range that identifies a partial word in string.
- string
String with the partial word from which to generate the result.
- language
Language to used in string. When
nil, this method uses the language selected in the Spelling panel.- spellDocumentTag
Identifies the spell document with ignored words to use.
Return Value
List of complete words from the spell checker dictionary in the order they should be presented to the user.
Availability
- Available in OS X v10.3 and later.
Declared In
NSSpellChecker.hcorrectionForWordRange:inString:language:inSpellDocumentWithTag:
Returns a single proposed correction if a word is mis-spelled.
Parameters
- range
The range of the word to be corrected.
- string
The string containing the proposed correction.
- language
The language.
- tag
An identifier unique within the application used to inform the spell checker which document that text is associated, potentially for many purposes, not necessarily just for ignored words. A value of 0 can be passed in for text not associated with a particular document.
Return Value
The proposed correct string.
Special Considerations
While correction functionality is available starting in OS X v10.6 as part of unified text checking, for convenience this method makes it available separately starting in OS X v10.7.
Availability
- Available in OS X v10.7 and later.
Declared In
NSSpellChecker.hcountWordsInString:language:
Returns the number of words in stringToCount.
Parameters
- stringToCount
The string to count the words in.
- language
The language of the string.
Return Value
The number of words in the string.
Discussion
If language is nil, the current selection in the Spelling panel’s pop-up menu is used.
Availability
- Available in OS X v10.0 and later.
Declared In
NSSpellChecker.hdismissCorrectionIndicatorForView:
Dismisses the correction indicator for the specified view.
Parameters
- view
The view.
Availability
- Available in OS X v10.7 and later.
Declared In
NSSpellChecker.hguessesForWordRange:inString:language:inSpellDocumentWithTag:
Returns an array of possible substitutions for the specified string.
Parameters
- range
The range of the string to check.
- string
The string to guess.
- language
The language of the string.
- tag
An identifier unique within the application used to inform the spell checker which document that text is associated, potentially for many purposes, not necessarily just for ignored words. A value of 0 can be passed in for text not associated with a particular document.
Return Value
An array of strings containing possible replacement words.
Availability
- Available in OS X v10.6 and later.
Declared In
NSSpellChecker.hhasLearnedWord:
Indicates whether the spell checker has learned a given word.
Parameters
- word
Word in question.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSSpellChecker.hignoredWordsInSpellDocumentWithTag:
Returns the array of ignored words for a document identified by tag.
Discussion
Invoke this method before closeSpellDocumentWithTag: if you want to store the ignored words.
Availability
- Available in OS X v10.0 and later.
Declared In
NSSpellChecker.hignoreWord:inSpellDocumentWithTag:
Instructs the spell checker to ignore all future occurrences of wordToIgnore in the document identified by tag.
Discussion
You should invoke this method from within your implementation of the NSIgnoreMisspelledWords protocol’s ignoreSpelling: method.
Availability
- Available in OS X v10.0 and later.
Declared In
NSSpellChecker.hlanguage
Returns the current language used in spell checking.
Return Value
The current spell checking language, as a string.
Discussion
The result string specifies the language using the language and regional designations described in “Language and Locale Designations” in Internationalization Programming Topics.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSSpellChecker.hlearnWord:
Adds the word to the spell checker dictionary.
Parameters
- word
The word to add.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSSpellChecker.hmenuForResult:string:options:atLocation:inView:
Provides a menu containing contextual menu items suitable for certain kinds of detected results.
Parameters
- result
The
NSTextCheckingResultinstance for the checked string.- checkedString
The string that has been checked.
- options
The options dictionary allows clients to pass in information associated with the document. See “Spell Checking Option Dictionary Keys” for possible key-value pairs.
- location
The location, in the view’s coordinate system, to display the menu.
- view
The view object over which to display the contextual menu.
Return Value
A menu suitable for displaying as a contextual menu, or adding to another contextual menu as a submenu.
Availability
- Available in OS X v10.6 and later.
Declared In
NSSpellChecker.hrecordResponse:toCorrection:forWord:language:inSpellDocumentWithTag:
Records the user response to the correction indicator being displayed.
Parameters
- response
The user’s response. The possible values are shown in
NSCorrectionResponse.- correction
The corrected word. This should match the original correction.
- word
The original word. This should match the original correction.
- language
The language being edited. This should match the original correction.
- tag
An identifier unique within the application used to inform the spell checker which document that text is associated, potentially for many purposes, not necessarily just for ignored words. A value of 0 can be passed in for text not associated with a particular document.
Discussion
When a correction is automatically proposed, the user may respond in one of several ways. Clients may report this to the spell checker so that it can learn from the user's response and adjust future correction behavior accordingly.
Availability
- Available in OS X v10.7 and later.
See Also
Declared In
NSSpellChecker.hrequestCheckingOfString:range:types:options:inSpellDocumentWithTag:completionHandler:
Requests that the string be checked in the background.
Parameters
- stringToCheck
The string to check.
- range
The range of the string to check.
- checkingTypes
The type of checking to be performed. The possible constants are listed in
NSTextCheckingTypeand can be combined using the C bit-wiseORoperator to perform multiple checks at the same time.- options
The options dictionary specifying the types of checking to perform. See “Spell Checking Option Dictionary Keys” for the possible keys and expected values.
- tag
An identifier unique within the application used to inform the spell checker which document that text is associated, potentially for many purposes, not necessarily just for ignored words. A value of 0 can be passed in for text not associated with a particular document.
- completionHandler
The completion handler block object will be called (in an arbitrary context) when results are available, with the sequence number and results.
The block takes four arguments:
- sequenceNumber
A monotonically increasing sequence number.
- results
An array of
NSTextCheckingResultobjects describing particular items found during checking and their individual ranges, sorted by range origin, then range end, then result type..- orthography
The orthography of the string.
- wordCount
The number of words in the range of the string.
Return Value
The return value is a monotonically increasing sequence number that can be used to keep track of requests in flight.
Availability
- Available in OS X v10.6 and later.
Declared In
NSSpellChecker.hsetAccessoryView:
Makes an view an accessory of the Spelling panel by making it a subview of the panel’s content view.
Parameters
- aView
The accessory view displayed in the receiver.
Discussion
The accessory view can be any custom view you want to display with the spelling panel. The accessory view is displayed below the spelling checker and the panel automatically resizes to accommodate the accessory view.
This method posts a notification named NSWindowDidResizeNotification with the Spelling panel object to the default notification center.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSSpellChecker.hsetAutomaticallyIdentifiesLanguages:
Sets whether the spell checker will automatically identify languages.
Parameters
- flag
YESif languages should be automatically identified, otherwiseNO.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSSpellChecker.hsetIgnoredWords:inSpellDocumentWithTag:
Initializes the ignored-words document (a dictionary identified by tag with someWords), an array of words to ignore.
Availability
- Available in OS X v10.0 and later.
Declared In
NSSpellChecker.hsetLanguage:
Returns whether the specified language is in the Spelling pop-up list.
Parameters
- language
The requested language.
Return Value
YES if the language is available in the pop-up list, otherwise NO.
Discussion
Listing 1 shows how languages can be specified in language. If the language specified is listed in the user’s list of preferred languages, the spell checker uses that language to accomplish its task.
Listing 1 Specifying the spell checker language
NSSpellChecker* spell_checker = [NSSpellChecker sharedSpellChecker]; |
// Sets language to French. The language method returns "fr". |
[spell_checker setLanguage:@"fr"]; |
// Sets language to the one spoken in Netherlands (English). The language method returns "en". |
[spell_checker setLanguage:@"NL"]; |
// Sets language to British English. The language method returns "en_GB". |
[spell_checker setLanguage:@"en_GB"] |
// Sets language to German. The language method returns "de". |
[spell_checker setLanguage:@"German"]; |
To learn about the strings you can use to specify a language in language, see “Language and Locale Designations” in Internationalization Programming Topics.
Availability
- Available in OS X v10.0 and later.
See Also
Declared In
NSSpellChecker.hsetSubstitutionsPanelAccessoryViewController:
Sets the substitutions panel’s accessory view.
Parameters
- accessoryController
The accessory view controller or
nilif there is none.
Discussion
The accessory view controller can accommodate be any custom view you want to display with the substitutions panel. The accessory view controller’s view is displayed below the substitutions list and the panel automatically resizes to accommodate the accessory view.
This method posts a notification named NSWindowDidResizeNotification with the substitutions panel object to the default notification center.
Availability
- Available in OS X v10.6 and later.
Declared In
NSSpellChecker.hsetWordFieldStringValue:
Sets the string that appears in the misspelled word field, using the string object aString.
Availability
- Available in OS X v10.0 and later.
Declared In
NSSpellChecker.hshowCorrectionIndicatorOfType:primaryString:alternativeStrings:forStringInRect:view:completionHandler:
Display a suitable user interface to indicate a correction may need to be made.
Parameters
- type
The correction type to display. See
NSCorrectionIndicatorTypefor possible values.- primaryString
The first string to be displayed, a correction or reversion according to the type of indicator.
- alternativeStrings
An array of alternative strings to insert. This array may be empty.
- rectOfTypedString
The rectangle of the typed text.
- view
The view in which the correction indicator is to be displayed.
- completionBlock
The Block called when a the correction indicator is dismissed.
The Block takes one argument:
- acceptedString
The correction string the user excepted. If the user does not select a correction string nil is returned.
Discussion
Only one indicator at a time may be displayed for a given view, and the only thing a client may do with the indicator after displaying it is to dismiss it using the dismissCorrectionIndicatorForView: method.
Availability
- Available in OS X v10.7 and later.
See Also
Declared In
NSSpellChecker.hspellingPanel
Returns the spell checker’s panel.
Return Value
The spell checking panel.
Availability
- Available in OS X v10.0 and later.
Declared In
NSSpellChecker.hsubstitutionsPanel
Returns the substitutions panel.
Return Value
The substitutions checking panel.
Availability
- Available in OS X v10.6 and later.
Declared In
NSSpellChecker.hsubstitutionsPanelAccessoryViewController
Returns the substitutions panel’s accessory view controller.
Return Value
The accessory view controller or nil if there is none.
Availability
- Available in OS X v10.6 and later.
Declared In
NSSpellChecker.hunlearnWord:
Tells the spell checker to unlearn a given word.
Parameters
- word
Word to unlearn.
Availability
- Available in OS X v10.5 and later.
See Also
Declared In
NSSpellChecker.hupdatePanels
Updates the available panels to account for user changes.
Discussion
This method should be called when a client changes some relevant setting, such as what kind of spelling, grammar checking, or substitutions it uses.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSSpellChecker.hupdateSpellingPanelWithGrammarString:detail:
Specifies a grammar-analysis detail to highlight in the Spelling panel.
Parameters
- problemString
Problematic grammatical unit identified by
checkGrammarOfString:startingAt:language:wrap:inSpellDocumentWithTag:details:.- detail
One of the grammar-analysis details provided by
checkGrammarOfString:startingAt:language:wrap:inSpellDocumentWithTag:details:.
Availability
- Available in OS X v10.5 and later.
Declared In
NSSpellChecker.hupdateSpellingPanelWithMisspelledWord:
Causes the spell checker to update the Spelling panel’s misspelled-word field to reflect word.
Discussion
You are responsible for highlighting word in the document and for extracting it from the document using the range returned by the checkSpelling:... methods. Pass the empty string as word to have the system beep, indicating no misspelled words were found.
Availability
- Available in OS X v10.0 and later.
Declared In
NSSpellChecker.huserPreferredLanguages
Provides a subset of the available languages to be used for spell checking.
Return Value
An array containing the user’s preferred languages for spell checking. The order is set in the system preferences.
Discussion
If automaticallyIdentifiesLanguages is YES, then text checking will automatically use this method as appropriate; otherwise, it will use the language set by setLanguage:.
The older checkSpellingOfString:startingAt:language:wrap:inSpellDocumentWithTag:wordCount: and checkGrammarOfString:startingAt:language:wrap:inSpellDocumentWithTag:details:. methods will use the language set by setLanguage:, if they are called with a nil language argument.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSSpellChecker.huserQuotesArrayForLanguage:
Returns the default values for quote replacement.
Parameters
- language
The language for quote replacement.
Return Value
An array of quote replacements used by the NSTextCheckingQuotesKey key-value pair.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSSpellChecker.huserReplacementsDictionary
Returns the dictionary used when replacing words.
Return Value
The dictionary.
Discussion
The key-value pairs in this dictionary are used by the NSTextCheckingQuotesKey when replacing characters and words.
Availability
- Available in OS X v10.6 and later.
See Also
Declared In
NSSpellChecker.hConstants
Spell Checking Option Dictionary Keys
The constants are optional keys that can be used in the options dictionary parameter of the checkString:range:types:options:inSpellDocumentWithTag:orthography:wordCount:, requestCheckingOfString:range:types:options:inSpellDocumentWithTag:completionHandler:, and menuForResult:string:options:atLocation:inView: methods.
NSString *NSTextCheckingOrthographyKey; NSString *NSTextCheckingQuotesKey; NSString *NSTextCheckingReplacementsKey; NSString *NSTextCheckingReferenceDateKey; NSString *NSTextCheckingReferenceTimeZoneKey; NSString *NSTextCheckingDocumentURLKey; NSString *NSTextCheckingDocumentTitleKey; NSString *NSTextCheckingDocumentAuthorKey;
Constants
NSTextCheckingOrthographyKeyAn
NSOrthographyinstance indicating an orthography to be used as a starting point for orthography checking, or as the orthography if orthography checking is not enabled.Available in OS X v10.6 and later.
Declared in
NSSpellChecker.h.NSTextCheckingQuotesKeyAn NSArray containing four strings to be used with
NSTextCheckingTypeQuote(opening double quote, closing double quote, opening single quote, and closing single quote in that order); if not specified, values will be taken from user's preferences.Available in OS X v10.6 and later.
Declared in
NSSpellChecker.h.NSTextCheckingReplacementsKeyAn NSDictionary containing replacements to be used with NSTextCheckingTypeReplacement; if not specified, values will be taken from user's preferences.
Available in OS X v10.6 and later.
Declared in
NSSpellChecker.h.NSTextCheckingReferenceDateKeyAn NSDate to be associated with the document, used as a referent for relative dates; if not specified, the current date will be used.
Available in OS X v10.6 and later.
Declared in
NSSpellChecker.h.NSTextCheckingReferenceTimeZoneKeyAn NSTimeZone to be associated with the document, used as a reference for dates without time zones; if not specified, the current time zone will be used.
Available in OS X v10.6 and later.
Declared in
NSSpellChecker.h.NSTextCheckingDocumentURLKeyAn NSURL to be associated with the document.
Available in OS X v10.6 and later.
Declared in
NSSpellChecker.h.NSTextCheckingDocumentTitleKeyAn NSString containing the title to be associated with the document.
Available in OS X v10.6 and later.
Declared in
NSSpellChecker.h.NSTextCheckingDocumentAuthorKeyAn NSString containing the name of an author to be associated with the document
Available in OS X v10.6 and later.
Declared in
NSSpellChecker.h.
NSCorrectionIndicatorType
These constants allow an application to specify the correction indicator type displayed.
enum {
NSCorrectionIndicatorTypeDefault = 0,
NSCorrectionIndicatorTypeReversion,
NSCorrectionIndicatorTypeGuesses
};
typedef NSInteger NSCorrectionIndicatorType;
Constants
NSCorrectionIndicatorTypeDefaultThe default indicator that shows a proposed correction.
Available in OS X v10.7 and later.
Declared in
NSSpellChecker.h.NSCorrectionIndicatorTypeReversionProvides the option to revert to the original form after a correction has been made.
Available in OS X v10.7 and later.
Declared in
NSSpellChecker.h.NSCorrectionIndicatorTypeGuessesShows multiple alternatives from which the user may choose the appropriate spelling.
Available in OS X v10.7 and later.
Declared in
NSSpellChecker.h.
Availability
- Available in OS X v10.7 and later.
Declared In
NSSpellChecker.hNSCorrectionResponse
The correction response passed to therecordResponse:toCorrection:forWord:language:inSpellDocumentWithTag: method.
enum {
NSCorrectionResponseNone,
NSCorrectionResponseAccepted,
NSCorrectionResponseRejected,
NSCorrectionResponseIgnored,
NSCorrectionResponseEdited,
NSCorrectionResponseReverted
};
typedef NSInteger NSCorrectionResponse;
Availability
- Available in OS X v10.7 and later.
Declared In
NSSpellChecker.hNotifications
NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification
Availability
- Available in OS X v10.7 and later.
Declared In
NSSpellChecker.hNSSpellCheckerDidChangeAutomaticTextReplacementNotification
Availability
- Available in OS X v10.7 and later.
Declared In
NSSpellChecker.h© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-05-14)