12

How can I disable spell checking for an NSTextView? In particular, the red lines that are automatically drawn. I know about the "Continuous Spell Checking" option in Xcode, and every option I have found in the documentation related to spell checking doesn't seem to take the red lines away.

David Beck
  • 10,099
  • 5
  • 51
  • 88
  • I have no idea why, but for whatever reason, changing the name of the property fixed it. – David Beck Aug 04 '12 at 14:52
  • changing the name of which property and where? – Michael Dautermann Aug 09 '12 at 21:26
  • The NSTextView property. – David Beck Aug 10 '12 at 01:05
  • There definitely seems to be some bug with it. I had the same problem, fixed it by adding `[self.textView setContinuousSpellCheckingEnabled:NO];` after `[self.textView setString:…]`, but then couldn't reproduce the original behavior when removing the line. – Patrick Pijnappel May 16 '13 at 09:46
  • @PatrickPijnappel Same here. I tried your suggestion by applying `isContinuousSpellCheckingEnabled = false` after setting a new value. Then I removed it right after in the next build and it was no longer necessary. – Klaas Jan 05 '17 at 09:24

3 Answers3

8

Select NSTextView (doubleClick in IB on it because NSTextView is in NSScrollView by default or select it in Document Outline) and go to Attributes Inspector -> Linguistics -> and uncheck Continous Spell Checking here:

Screenshot

Result:

enter image description here

Justin Boo
  • 10,132
  • 8
  • 50
  • 71
  • 3
    @David Beck mentioned in the question that he knows about this option, but it's not taking the red lines away. – Greg Aug 20 '13 at 19:52
4

I don't know what you tried, but [self.textView setContinuousSpellCheckingEnabled:NO]; worked for me.

Justin Boo
  • 10,132
  • 8
  • 50
  • 71
rdelmar
  • 103,982
  • 12
  • 207
  • 218
1

After unsetting continuousSpellCheckingEnabled clean your build folder and run again. Seems as though it is holding onto the setting between builds (quite surprisingly!). Your observation that changing the property name solved the issue led me to this solution -- still an issue almost five years after you asked.

Ben Flynn
  • 18,524
  • 20
  • 97
  • 142