Skip to content

Instantly share code, notes, and snippets.

View merrysuperstar's full-sized avatar

Michael Ehrmann merrysuperstar

  • Leitmotif / TheCodingMonkeys / Subethaedit
  • Munich, Germany
View GitHub Profile
@monkeydom
monkeydom / SingletonMacro.h
Last active December 24, 2015 17:19
New try on Singleton non-redundancy
/** usage example
@implementation ABCPlayerManager
+ (instancetype)sharedPlayerManager {
return TCM_SINGLETON(ABCPlayerManager);
}
@end
*/
#define TCM_SINGLETON(THECLASS) ({ \
static THECLASS *s_sharedInstance = nil; \