• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: To Document-Base or not Document-Base...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: To Document-Base or not Document-Base...


  • Subject: Re: To Document-Base or not Document-Base...
  • From: Mike Ferris <email@hidden>
  • Date: Fri, 3 Jan 2003 09:28:49 -0800

I am not sure if I should make my application document-based or not. It
doesn't handle documents in the normal way, persay. There is a central
database per user that takes care of loading and unloading settings and
"documents" (that aren't really individual documents... this is hard to
explain) automatically. It isn't like TextEdit where its main window
revolves around typing and formatting and saving/opening/printing, etc.
However, there WILL be windows for typing in contents of things such as
emails, notes, etc.


NSDocument is not perfectly suited for dealing with "documents" whose contents do not come from disk files, but it is not totally unsuited for it either. I would say it's basically a toss-up whether you'd be better off subclassing and overriding enough behavior to make NSDocument work for you or to just redo it yourself...

So, the final question is: should I create my project as a document-based
app in PB, or should I just have a normal application. Oh, also, I want to
have complete control over which window appears at the startup of the
application (it won't be a main window or anything). In a document-based
app, I think I can overload
- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)theApplication
in my application delegate, but I haven't test to see if it actually keeps
Cocoa from automatically opening windows at startup or not.


Whether you create the project from one template or another won't have much affect in the long run. There's nothing magic about project templates and the difference between the Cocoa App and the Cocoa Doc-based App is that the doc-based one includes a starter NSDocument subclass and some extra Info.plist goop.

-applicationShouldOpenUntitledFile: will be consulted for doc-based apps and if it returns NO, then no document will be created. -applicationOpenUntitledFile: will also be called, if it is there instead of letting NSDocumentController handle creating a new document.

Mike
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >To Document-Base or not Document-Base... (From: mw <email@hidden>)

  • Prev by Date: Re: subclassing NSTabViewItem
  • Next by Date: Re: To Document-Base or not Document-Base...
  • Previous by thread: To Document-Base or not Document-Base...
  • Next by thread: Re: To Document-Base or not Document-Base...
  • Index(es):
    • Date
    • Thread