• 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: Passing References During Initialization / Nib Loading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing References During Initialization / Nib Loading


  • Subject: Re: Passing References During Initialization / Nib Loading
  • From: Brad Gibbs <email@hidden>
  • Date: Fri, 12 Jun 2009 09:05:37 -0700

There's a great macro available for creating singletons on the cocoa with love blog. It's dead simple to use and it does override init and copy methods to make sure only one instance is created.



On Jun 12, 2009, at 8:50 AM, Michael Ash <email@hidden> wrote:

On Fri, Jun 12, 2009 at 4:13 AM, Quincey
Morris<email@hidden> wrote:
On Jun 12, 2009, at 00:27, Michael Ash wrote:

Singleton-ness is a property of the API, not the
implementation. If the API provides a single instance which you use,
then it's a singleton. Enforcing that single instance is entirely up
to the implementation of the API. It's not a necessary feature of a
singleton, and it's not even necessarily a good feature to have.

Perhaps so. I'm not inclined to insist on my perspective if you feel it
misrepresents the situation enough to comment on it.


I'll point out, though, that there is no inherent singleness in Brad's
situation (that is, barring information about the application design that's
not been part of the discussion, there's no obvious reason why he can't
choose to have multiple main window controllers) *beyond* the proposed
decision to implement [MainWindowController sharedWindowController]. That
proposal was a pragmatic solution to a design problem that didn't really
involve the cardinality of main window controllers. That last point is
really the point I was trying to make.

Fair enough. I just didn't want others to think that if they wanted a "true" singleton then they had to go through and override alloc, init, etc., the way certain Apple sample code does. Nothing more.

Mike
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Passing References During Initialization / Nib Loading (From: Brad Gibbs <email@hidden>)
 >Re: Passing References During Initialization / Nib Loading (From: Quincey Morris <email@hidden>)
 >Re: Passing References During Initialization / Nib Loading (From: Brad Gibbs <email@hidden>)
 >Re: Passing References During Initialization / Nib Loading (From: Quincey Morris <email@hidden>)
 >Re: Passing References During Initialization / Nib Loading (From: Quincey Morris <email@hidden>)
 >Re: Passing References During Initialization / Nib Loading (From: Michael Ash <email@hidden>)
 >Re: Passing References During Initialization / Nib Loading (From: Quincey Morris <email@hidden>)
 >Re: Passing References During Initialization / Nib Loading (From: Michael Ash <email@hidden>)

  • Prev by Date: Re: Passing References During Initialization / Nib Loading
  • Next by Date: Re: Discloser triangle
  • Previous by thread: Re: Passing References During Initialization / Nib Loading
  • Next by thread: Re: Passing References During Initialization / Nib Loading
  • Index(es):
    • Date
    • Thread