NSTextView with Smart Quotes disabled, still replaces quotes

You can disable smart quotes for your NSTextView with:

self.textView.automaticQuoteSubstitutionEnabled = NO;

Not setting the checkmark in the interface builder doesn't seem to work since OS X 10.9 Mavericks.

See NSTextView setAutomaticQuoteSubstitutionEnabled:

Also you can use this for a more detailed control over the text replacement.

self.textView.enabledTextCheckingTypes = 0;

See NSTextView setEnabledTextCheckingTypes:

Also in Mavericks there is smart quotes enabled by default in System Preferences → Keyboard → Text. You can disable this as a personal preference.


Xcode 7.3 still have this problem.

The way to set these properties in IB.

enter image description here


This problem is still not fixed as of Yosemite / Xcode 6.1

To turn off all the substitution options that IB seems to ignore, I had to do this:

self.textView.automaticQuoteSubstitutionEnabled = NO;
self.textView.automaticDashSubstitutionEnabled = NO;
self.textView.automaticTextReplacementEnabled = NO;

Tags:

Macos

Cocoa

Xcode