I have a Class that I wish to implement as Singleton.
I wish that the only way an Instance of this class may be created / accessed is via:
+(MYClass*)sharedInstance
method. alloc and init are called within the method implementation (of course).
Is there a way to block the usage of alloc and init, or to make them 'empty', if there's an attempt to create an instance of that class NOT via the sharedInstance method (but through alloc + init directly)?
If you are using arc, add compiler flag -fno-objc-arc to the file.
"alloc + init" will call sharedManager method.