• 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: Newbie questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie questions


  • Subject: Re: Newbie questions
  • From: j o a r <email@hidden>
  • Date: Mon, 23 Dec 2002 16:58:00 +0100

There is more than one way to skin a cat...

That said, I would suggest that you let every document have a NSWindowController where you place most application specific code, and leave the NSDocument subclass as a model class.

Something like this:

(1 Document Controller)
1 or more Documents
1 Window Controller
1 or more Windows

alternatively

(1 Document Controller)
1 or more Documents
1 or more Window Controllers
1 Window

(I placed the document controller in parenthesis because you often don't need to mess with it directly)

Also, you say keep referring to your "nib". Keep in mind that the nib file is only a storage for user interface elements when your application is not running / not using them. In the running application you shouldn't think of nib files as participants in the MVC tango - they are just file based storage of user interface elements that your window controller will use.

j o a r

On Monday, Dec 23, 2002, at 16:41 Europe/Stockholm, Ted Lowery wrote:

This seems a little confusing to me. In the MVC paradigm of cocoa development, should I consider "myDocument" for a doc-based application to be the model or the controller for my nib? I've been thinking it was the model, since it knows how to load and save the data for the document, but as I add more functionality, there's no clear way to access the controller from outside the nib, however I can access the [window document] which makes me think myDocument is the controller. If that's the case, I guess I should refactor the data loading behavior to another object, that myDocument (as a controller) knows how to access.

Am I on the right path, or still confused?
_______________________________________________
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: 
 >Newbie questions (From: Ted Lowery <email@hidden>)

  • Prev by Date: Re: Help with First Responder
  • Next by Date: Re: Help with First Responder
  • Previous by thread: Newbie questions
  • Next by thread: Re: Newbie questions
  • Index(es):
    • Date
    • Thread