I use singletons often when I need to have a shared instance object across multiple controllers. However, what I don’t like is that I still have to import the singleton header at the top of a class whenever I want to use it.
Is there anyway to create an object that’s only instantiated once at runtime that all classes can access globally without having to import it?
well, you could just throw
#import "MONSingleton.h"in the prefix header… just don’t get too carried away, because it can make your build times unnecessary long*.*or shorter, if used correctly.