It depends on what you mean by "in class". If it is an instance variable, your problems are over because you are guaranteed that the instance variable will be automatically initialized to some form of zero (i.e. CGSizeZero ). But if you just mean "in my code somewhere", for example. automatic variable, then there is no such test; it is entirely up to you to initialize before use, and as long as you do, the value can be anything at all (sorry, but this is how C works).
All in all, your question in itself is a "bad smell." If it matters to you at some point in your code whether this value has been initialized, you are doing it wrong. This is your value; you needed to initialize it (for example, when your shared object was initialized). Or, if for some reason you need to know if your setter has ever been called, you need to add a boolean to your setter, which tells you if it was ever called.
source share