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 8395047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:12:12+00:00 2026-06-09T20:12:12+00:00

How do I prevent a window title from displaying Edited for an NSDocument which

  • 0

How do I prevent a window title from displaying “Edited” for an NSDocument which is dirty?

I’m managing saving and autosaving myself, using a web service, and just don’t want the distraction in the title bar.

I’ve tried overriding:

  • NSDocument’s -isDocumentEdited and -hasUnautosavedChanges always to return NO.
  • -[NSWindowController setDocumentEdited] to do nothing, or always to use NO regardless of the parameter’s actual value.
  • -[NSWindowController synchronizeWindowTitleWithDocumentName] to do nothing.
  • -[NSWindow setDocumentEdited] to do nothing, or always to use NO regardless of the parameter’s actual value.

In all cases, the title bar still changes to Edited when I make changes to a saved document.

If I override -[NSDocument updateChangeCount:] and -[NSDocument updateChangeCountWithToken:forSaveOperation:] to do nothing, I can prevent this from happening, but it affects saving, autosaving, and other document behaviors, too.

I also tried this:

[[self.window standardWindowButton: NSWindowDocumentVersionsButton] setTitle:nil];

That displayed a blank string instead of Edited, but the dash still appeared – the one which normally separates the document name and Edited.

Any idea how to pry apart this part of the window from the document?

  • 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-06-09T20:12:13+00:00Added an answer on June 9, 2026 at 8:12 pm

    Several options:

    1. To get a pointer to the “dash”, look for a TextField in [window.contentView.superview.subviews] with a stringValue equals to “-“. You can set its text to an empty string as well.

      @implementation NSWindow (DashRetrivalMethod)
      - (NSTextField*)versionsDashTextField
      {
          NSTextField* res = nil;
          NSView* themeFrame = [self.contentView superview];
          for (NSView* tmp in [themeFrame subviews])
          {
              if ([tmp isKindOfClass:[NSTextField class]])
              {
                  if ([[(NSTextField*)tmp stringValue] isEqualToString:@"—"])
                  {
                        res = (NSTextField*)tmp;
                        break;
                  }
              }
          }
          return res;
      }
      @end
      
    2. You can override NSWindow’s -setRepresentedURL:. This would also affect the NSWindowDocumentIconButton and the popup menu, but you can manually create it if you want by: [NSWindow standardWindowButton: NSWindowDocumentIconButton].

    3. Override one of these three NSDocument’s undocumented methods:

      // Always return here NO if you don't want the version button to appear. 
      // This seems to be the cleanest options, besides the fact that you are 
      /// overriding a private method.
      - (BOOL)_shouldShowAutosaveButtonForWindow:(NSWindow*)window;
      
      // Call super with NO
      - (void)_setShowAutosaveButton:(BOOL)flag; 
      
      // Here the button and the dash are actually created
      - (void)_endVersionsButtonUpdates; 
      
      // Here Cocoa hide or unhide the edited button
      - (void)_updateDocumentEditedAndAnimate:(BOOL)flag
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I will prevent a window from iTunes to be opened. I googled a lot
As the title suggests, I need a workaround to prevent mobile safari from scrolling
In wpf how can i prevent user from moving the windows by dragging the
Is there a way to hide the windows command prompt or prevent it from
When a modal dialog box is present, messages sent to the main window using
I have a asp.net MVC3 web application in which i search for a certain
I would like to prevent a user from either: Copy and pasting from the
How to prevent a window to deminiaturizing when a user click on the dock
How can I make this more secure and safe: Strip unsafe characters from title
I'm using Ubuntu 10.04 and I'm trying to run a WxRuby example which I

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.