Design Element
Comment on "Class Variables and Categories"
by Geoff Schmit — Nov 29
I'm new to the Objective C world, so take this with a couple of grains of salt. I assume that one reason why categories are not allowed to add additional instance variables is that, if they could, the size of the object could not be known. However, class variables do not affect the size of the object and, therefore, theoretically at least, new class variables could be defined by categories.

Just as a warning, I've encountered a handful of issues related to execution order and execution in general when using the constructor attribute as well as C++ static constructors and destructors in a highly componentized system running on Mac OS X 10.3. dyld was dramatically improved and a vast major of these issues were addressed in Mac OS X 10.4.
Back to "Class Variables and Categories"
Design Element

Copyright © Scott Stevenson 2004-2015