Correct Singleton Pattern Objective C (iOS)?
I found some information in the net to create a singleton class using GCD. Thats cool because it's thread-safe with very low overhead. Sadly I could not find complete solutions but only snippets of the sharedInstance method. So I made my own class using the trial and error method - and et voila - the following came out: @implementation MySingleton // MARK: - // MARK: Singleton Pattern using GCD + (id)allocWithZone:(NSZone *)zone { return [[self sharedInstance] retain]; } - (id)copyWithZone:(NSZone *)zone { return self; } - (id)autorelease { return self; } - (oneway void)release { /* Singletons