Re: Getting a reference to the data model from a delegate
Re: Getting a reference to the data model from a delegate
- Subject: Re: Getting a reference to the data model from a delegate
- From: James DiPalma <email@hidden>
- Date: Sun, 19 Jan 2003 11:43:23 -0800
In a document based application, a document's data is not a singleton
type object unless an application can prevent multiple documents from
opening.
MVC also does not imply that a model object is a singleton.
-jim
From: mw <email@hidden>
From: Rob In der Maur <email@hidden>
Now my question:
I'm having problems getting a reference back to my data model from a
delegate in a document based application, which also has a dedicated
NSWindowController class.
If this data model that you are talking about is the same data model as
described in the MVC paradigm, then couldn't you simply make the data
model
class a singleton? This would just mean having a reference to itself
in the
class, and then having a +sharedInstance method to return it. That
way, no
matter where you are in your application, you can gain access to the
data
model (as long as you include its header file ;-) ).
_______________________________________________
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.