I'm sure it is wishful thinking, but is there a counterpart to +initialize
that will automatically get called when all instances of a class have been dealloc'ed?
I allocate a singleton object in +initialize, which is called before my first class instance gets alloc'ed. I would love to be able to release the object once my class instances have all been deallocated. However, if my objects of my class ever get reallocated, then I would need +initialize
to get called again. I suspect Cocoa doesn't do that level of class management and it is probably up to me to wrap my class in a class manager class...
Am I correct?