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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:47:18+00:00 2026-05-16T16:47:18+00:00

I have a Cocoa document-based app that (currently at least) functions as a basic

  • 0

I have a Cocoa document-based app that (currently at least) functions as a basic text editor. It saves .txt, .rtf, and .rtfd, and loads those plus .doc and .docx. If I open a .doc or .docx file and edit it, then try to close, it reminds me to save, but the save option doesn’t do anything since the application is only a viewer for those types of files. How can I make that function as “Save As” for types that can only be viewed, like .doc and .docx?

  • 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-16T16:47:19+00:00Added an answer on May 16, 2026 at 4:47 pm

    Override the saveDocumentWithDelegate::: in your customised NSDocument to the following:

    - (void)saveDocumentWithDelegate:(id)delegate didSaveSelector:(SEL)didSaveSelector contextInfo:(void *)contextInfo
    {
      if (delegate != nil)
      {
        // use delegate or contextInfo to decide what operation you need to use...
    
        [self runModalSavePanelForSaveOperation:NSSaveAsOperation
                                       delegate:delegate 
                                didSaveSelector:didSaveSelector 
                                    contextInfo:contextInfo];
      }
      else
      {
        [super saveDocumentWithDelegate:delegate 
                        didSaveSelector:didSaveSelector
                            contextInfo:contextInfo];
      }
    }
    

    By default the delegate is either an NSWindow on window close or NSDocumentController if you quit the application and the controller enumerates the windows for reviewing changes.

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

Sidebar

Related Questions

I have a simple document-based Cocoa app that acts as a viewer for .wav
I have a Cocoa, Document-based Mac OS X application. One feature that I have
I have a basic Cocoa app with a custom NSCollectionView that overrides drawRect: to
Environment: xcode 3.2.1, document-based core-data application. I have a document-based cocoa app which uses
I have a document-based Cocoa app. During runtime, I load an additional nib from
I have created a Cocoa document based picture drawing application. I want that the
I am building a Non-Document-based cocoa app that I want to behave as follows:
Editing my nib for a document-based Cocoa application, I see that when I have
I have a document-based Cocoa application that has to start up a sub-process before
Assume I have a Cocoa-based Mac or iOS app. I'd like to run a

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.