• 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: Getting a reference to the data model from a delegate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Getting a reference to the data model from a delegate (From: mw <email@hidden>)

  • Prev by Date: Is a file used by another application?
  • Next by Date: Re: UUID Generation in Cocoa
  • Previous by thread: Writing chars in a view
  • Next by thread: Re: Getting a reference to the data model from a delegate
  • Index(es):
    • Date
    • Thread