• 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: Singleton as a common area?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Singleton as a common area?


  • Subject: Re: Singleton as a common area?
  • From: "Jonathan del Strother" <email@hidden>
  • Date: Wed, 20 Feb 2008 21:15:13 +0000

On Wed, Feb 20, 2008 at 9:03 PM, James Hober <email@hidden> wrote:
>
>  On Feb 20, 2008, at 12:04 PM, Jerry LeVan wrote:
>
>  > It seems to me that a singleton object could be used
>  > to hold lots of global state info and it would be
>  > easy to instantiate the singleton in each of the
>  > source files to access the stashed info...
>  >
>
> > Is this a reasonable way to share info?
>
>  Sometimes you just create a single instance of a class.
>
>  Other times you enforce that only zero instances or one instance can
>  ever be created.  To do this second thing,
>
>  http://developer.apple.com/documentation/Cocoa/Conceptual/
>  CocoaFundamentals/CocoaObjects/chapter_3_section_10.html
>

...and if you don't want to re-implement that for each of your
singletons, FTSWAbstractSingleton is a nice starting point -
http://www.cocoadev.com/index.pl?FTSWAbstractSingleton
_______________________________________________

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: 
 >Re: Singleton as a common area? (From: James Hober <email@hidden>)

  • Prev by Date: Re: Rotated NSImage drawAtPoint:... slow (*$?! photoshop)
  • Next by Date: Re: MPTask equivalent?
  • Previous by thread: Re: Singleton as a common area?
  • Next by thread: NSCollectionView / NSArrayController binding issues
  • Index(es):
    • Date
    • Thread