Using NSDocument w/o always displaying the document window

  • I'm trying to build a document based Cocoa app, but I don't always want
    to show my document window. My documents are more like command files.
    They're created elsewhere and my app opens them and then depending on
    the content either allows updates (shows the window) or just processes
    the commands (no document window, just dialogs, or maybe I need
    alternate document windows).

    I haven't figured out how to not show the main document window. Is this
    even possible in an NSDocument based app, or do I need to take another
    approach? I'd prefer to stay document based if possible. Creating
    different document types (.xyz vs. .abc) isn't an option.

    Thanks for any tips,
    William
  • > I'm trying to build a document based Cocoa app, but I don't always
    > want
    > to show my document window. My documents are more like command files.
    > They're created elsewhere and my app opens them and then depending on
    > the content either allows updates (shows the window) or just processes
    > the commands (no document window, just dialogs, or maybe I need
    > alternate document windows).
    >
    > I haven't figured out how to not show the main document window. Is
    > this
    > even possible in an NSDocument based app, or do I need to take another
    > approach? I'd prefer to stay document based if possible. Creating
    > different document types (.xyz vs. .abc) isn't an option.

    You can override makeWindowControllers and there simply do nothing
    for documents for which you don't need a window. The following link
    may help you though it is about something slightly different (one
    window for all documents): http://www.cocoadev.com/index.pl?
    DocumentBasedAppWithOneWindowForAllDocuments

    Cheers, Patrick
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today