Simply declare your class in your header file like so:

@interface MyClass : NSObject

+ (RecordingsMgr*)instance;


Then in your .m file, declare the instance function like so:

@implementation MyClass

+ (MyClass*)instance {
    static MyClass* _myClassInstance = nil;
    if (!_myClassInstance) {
        _myClassInstance = [[MyClass alloc] init];
    return _myClassInstance;


Then, whenever you need the instance somewhere, get it like so:

[[MyClass instance] someInstanceMethod]

Beautifully simple, and no mucking around with app delegates, it’ll simply get created whenever first needed. Not thread safe, however, so stick to the main thread.


If you’re concerned about thread safety, you can use this technique:

Thanks for reading! And if you want to get in touch, I'd love to hear from you: chris.hulbert at gmail.