• 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: NSDocument as controller vs. as model
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: NSDocument as controller vs. as model


  • Subject: RE: NSDocument as controller vs. as model
  • From: Brian Hook <email@hidden>
  • Date: Mon, 01 Oct 2001 11:07:28 -0700
  • Organization: Pyrogon, Inc.

> [mailto:email@hidden] On Behalf Of Bill Cheeseman

> Somewhere in the documentation you will see a suggestion that
> it's OK to use NSDocument as both model and controller in
> very simple applications. But if you anticipate having even a
> moderately complex or extensive data structure, my feeling is
> that it's best to leave NSDocument as a pure controller and
> create separate object(s) for your model. It should make
> extensibility easier. That's how I did it in Vermont Recipes,
> and it's working out pretty well.

That's pretty much what I thought. So in reality, the MVC paradigm
expands into:

application delegate (the "meta controller"?)
document controller controller (NSDocumentController...ugh, the
nomenclature is ghastly)
document controller (NSDocument)
document/model (app specific)
window controller (NSWindowController or subclass)
windows (NSWindow/Panel/etc.)

Then you would typically have a MainMenu.nib with no window, just the
application's delegate as File's Owner (?). Then auxiliary NIBs will
store specific windows and their various controllers, e.g. a
Document.nib that would have a document window and an NSDocument as the
File's Owner?

Does this sound right? Sorry if I'm sounding confused, but this is a
lot of information to grasp at once, especially for those of us crippled
with a C++/MFC background =)

Brian


  • Follow-Ups:
    • Re: NSDocument as controller vs. as model
      • From: Bill Cheeseman <email@hidden>
References: 
 >Re: NSDocument as controller vs. as model (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: RE: NSScrollView and general IB annoyance
  • Next by Date: Re: Odd stuff with Cocoa-Java
  • Previous by thread: Re: NSDocument as controller vs. as model
  • Next by thread: Re: NSDocument as controller vs. as model
  • Index(es):
    • Date
    • Thread