Skip to content

Tag Archives: design patterns

Singletons in Cocoa/Objective-C

I’ll preface this post with the standard advice: *Don’t create singletons if you don’t absolutely have to.* In general, if you’re creating a global “manager” object of some sort, you’re doing something wrong. That said, there’s still occasionally a reason to have such a global singleton, such as a “default something.” The sample code in […]