• 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: Best practices with singletons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best practices with singletons


  • Subject: Re: Best practices with singletons
  • From: Seth Willits <email@hidden>
  • Date: Sun, 08 Jun 2014 12:11:38 -0700

The practical answer in short is: Just always access through +sharedInstance, no need to pre-initialize, and only use it on the main thread.

This is one of those threads that will easily become a stupidly long debate that's been had a dozen times before. If you're interested in all of the intricate discussion about thread safety and how singletons are the spawn of satan, go search the archives and Google.


--
Seth Willits




_______________________________________________

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: 
 >Best practices with singletons (From: William Squires <email@hidden>)

  • Prev by Date: File's owner in nib file
  • Next by Date: Re: File's owner in nib file
  • Previous by thread: Re: Best practices with singletons
  • Next by thread: Re: Best practices with singletons
  • Index(es):
    • Date
    • Thread