Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7025927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:02:57+00:00 2026-05-28T00:02:57+00:00

The NSTextView class allows the user to dis-/enable features like spelling while typing with

  • 0

The NSTextView class allows the user to dis-/enable features like “spelling while typing” with the context menu (right click). But when I use a NSTextView in my own app, those preferences are not saved automatically by the text view itself, which means that I have to save them separately – right?

Now I also want to allow the user to change those settings in my app preferences (like in TextEdit). What I do is to save the text view preferences in the user defaults, which means that every time the user changes the setting in the app preferences, I apply those settings and save them. It’s pretty easy to accomplish that except the one case where the user changes the text view setting with the context menu and not through the app preferences.

My question now: How can I get notified when the settings of a NSTextView is changed, so I can save them?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:02:58+00:00Added an answer on May 28, 2026 at 12:02 am

    I’ve done a project where I have subclassed NSTextView and I can easily catch any setting changes that have been made by the user.

    So, for you to do this, simply create a new .h & .m file and declare it like this:

    (in the .h file)

    @interface BrutellaTextView : NSTextView
    
    @end
    

    (in the .m file)

    @interface BrutellaTextView
    
    - (void)setContinuousSpellCheckingEnabled:(BOOL)flag
    {
        // here I am just setting user defaults... you may choose
        // to have some other place to save the settings
        NSUserDefaults * userDefaults = [NSUserDefaults standardUserDefaults];
        if(userDefaults)
        {
            [userDefaults setBool: flag forKey: @"continuousSpellCheckingEnabled"];
        }
    
        // and to get the functionality to actually happen, 
        // call the superclass
        [super setContinuousSpellCheckingEnabled: flag];
    }
    
    @end
    

    (and you can override other NSTextView methods to capture when other settings change, such as setRulerVisible:).

    Now, when you are in your XIB file, make sure to set the CustomClass of your text view to be BrutellaTextView and you’ll be all set!

    There are no notifications that you can register to get NSTextView settings changes, so as far as I’m concerned, this is the best way to do what you’re trying to do.

    I hope this answer helps you out!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to enter text in a NSTextView so that when I hit
I have an NSTextView with an NSTableView in a window. I'd like to be
I want to add a data detector in an NSTextField / NSTextView like in
How can I add tokens, like NSTokenField , to a NStextView ?
I am thinking about modifying my NSTextView to look like an A4 sheet. So
I've an NSTextView with with several semi-colon separated strings. I need to find on
I have an NSTextView with text & images in it, which is supposed to
I have a subclassed NSTextView that I am manipulating in a separate thread (using
I want to programatically create an NSTextView. How can I determine the correct frame
I am working on an app with an NSTextView. When I paste random bytes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.