Turn off OS X 10.7 Lion's “auto-correct” feature programmatically?

前端 未结 2 1301
感动是毒
感动是毒 2021-01-26 23:05

OS X Lion has an iPhone-like autocorrect feature as you\'re typing.

This feature interferes with my typing app. The people using my app would not want it turned on a

2条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-26 23:44

    Finally, there is additional API to support the new global user preference settings for automatic text replacement and spelling correction. NSTextView now by default will keep track of and follow these settings automatically, but applications using NSTextView can override that by programmatically using existing NSTextView methods such as -setAutomaticTextReplacementEnabled: and -setAutomaticSpellingCorrectionEnabled: to control an individual text view's settings. The new API is primarily for non-text view clients who wish to keep track of the settings for themselves, using the NSSpellChecker class methods to determine their values, and optionally also notifications to determine when the settings have changed.

    + (BOOL)isAutomaticTextReplacementEnabled;
    + (BOOL)isAutomaticSpellingCorrectionEnabled;
    
    NSString * const NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification;
    NSString * const NSSpellCheckerDidChangeAutomaticTextReplacementNotification;
    

    https://developer.apple.com/library/mac/#releasenotes/Cocoa/AppKit.html

提交回复
热议问题