Re: Disable Text Replacement
Re: Disable Text Replacement
- Subject: Re: Disable Text Replacement
- From: Andreas Höschler <email@hidden>
- Date: Tue, 10 Feb 2015 17:42:03 +0100
Hi Jens,
> Have you tried turning off automaticDashSubstitutionEnabled?
Thanks a lot for you response. I goggled for automaticDashSubstitutionEnabled and landed here:
http://stackoverflow.com/questions/19801601/nstextview-with-smart-quotes-disabled-still-replaces-quotes <http://stackoverflow.com/questions/19801601/nstextview-with-smart-quotes-disabled-still-replaces-quotes>
On this page I found
Also you can use this for a more detailed control over the text replacement.
self.textView.enabledTextCheckingTypes = 0;
See NSTextView setEnabledTextCheckingTypes: <https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTextView_Class/Reference/Reference.html#//apple_ref/occ/instm/NSTextView/setEnabledTextCheckingTypes:>
I finally solved the problem by doing:
- (id)initWithFrame:(NSRect)frameRect textContainer:(NSTextContainer *)container
{
self = [super initWithFrame:frameRect textContainer:container];
...
[self setAutomaticQuoteSubstitutionEnabled:NO];
[self setContinuousSpellCheckingEnabled:NO];
[self setAutomaticTextReplacementEnabled:NO];
[self setEnabledTextCheckingTypes:NO]; // <— this is critical and required to get rid of the unwanted text replacements
...
return self;
}
What puzzles me is that [self respondsToSelector:@selector(setAutomaticQuoteSubstitutionEnabled:)] returns NO!? How can this be?
Anyway, thanks a lot for your hint! Problem solved!
Andreas
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden