Showing posts with label GCD. Show all posts
Showing posts with label GCD. Show all posts

Sunday, August 25, 2013

Anatomy of a Singleton

So why would I want to cover such a fundamental concept as how to create a singleton?  Well there are two reasons.  First, it is actually surprising how few developers I come across that know how to make an effective singleton object - so perhaps the concept, though fundamental, is not nearly so basic.  Second, as with many patterns in programming, there are many ways to accomplish the same task, and that can be fun to examine.  Let's step through the ways we can implement a singleton in Objective-C, some of which are applicable in concept to other languages too.

Lots of ways to skin a cat...er...singleton