Why not use +(void)initialize?
rpetrich opened this issue · 2 comments
rpetrich commented
+initialize
is guaranteed to be called from inside the Objective-C runtime lock the first time the target class receives a message.
cjhanson commented
The current implementation supports teardown and deallocation. If you used initialize you'd only get it called once for the entirety of the application lifetime.
rpetrich commented
Unless I've misinterpreted your implementation, purgeSharedInstance
is completely unthreadsafe and should only be used on app shutdown anyway. Resurrecting the singleton in that case is of little use.