• 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: NSDocuments without window associations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocuments without window associations


  • Subject: Re: NSDocuments without window associations
  • From: Bill Cheeseman <email@hidden>
  • Date: Tue, 05 Nov 2002 07:48:57 -0500

on 02-11-04 10:10 PM, James DiPalma at email@hidden wrote:

> How to implement a model class? A simple start would be subclassing
> NSDocument with a class that:
> - has an instance variable for a model object
> - alloc/inits a model during its init method
> - forwards all file i/o calls to this model instance

The book version of my Vermont Recipes Web site (URL below) spells all this
out with example code. For that matter, if I recall correctly, the Web site
does, too. The book will be out in the next few weeks (officially Nov. 12),
and the Web site's sample recipes will be updated at about the same time.

My NSDocument subclass is extremely short. All of the application's data and
data behaviors are in a bunch of much more complex model classes subclassed
from NSObject.

Neither the NSDocument subclass nor the model classes have any reference
whatever to the application's window controller. All communications to the
controller are via notifications, which the controller registers to observe.
This makes the model classes very independent and reusable.

As far as I know, this is a pretty standard Cocoa document-based application
architecture.

--

Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com

The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont - http://members.valley.net/croquetvermont
_______________________________________________
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: 
 >Re: NSDocuments without window associations (From: James DiPalma <email@hidden>)

  • Prev by Date: Re: Better random screensaver
  • Next by Date: Re: Calling the same function in multiple classes
  • Previous by thread: Re: NSDocuments without window associations
  • Next by thread: Calling the same function in multiple classes
  • Index(es):
    • Date
    • Thread