views:

112

answers:

2

If instance variables belong to an instance of a class, class variables would belong to an instance of a metaclass, I should think. But my experience with the Objective-C metaclass tells me that this is unlikely.

I'm wondering what class_getClassVariable does as opposed to class_getInstanceVariable, and why there is not a class_setClassVariable in the runtime.

+1  A: 

The class_getClassVariable() function doesn't make sense, because there's no such thing as a class variable in Objective C.

My guess is that class variables are supported by the runtime, but not by the language.

Philippe Leybaert
+6  A: 

I found a discussion about it here: http://lists.apple.com/archives/objc-language/2008/Feb/msg00021.html

Yuji