Yes, the class object is a fully functional object, so you can do something with it that you can do with a regular object.
However, itβs simpler and easier to use a global variable.
ps Associating it with [self class] not the same as using a global variable, because [self class] gives you the actual class of the current object, which may change because this method is inherited by subclasses. If the global variable will always be the same variable.
source share