back in the old days you would be able to go myClass.MY_CONSTANT and that would return to you the value of MY_CONSTANT which is specific to myClass
in objective c if i go #define MY_CONSTANT i can't access it outside of the class
i can't put anything in the @interface part because it just throws compile errors
and everything else i can think of throws an error
is it possible in objective c to just go myClass.MY_CONSTANT? and if so then how am i meant to declare MY_CONSTANT in myClass? i don't want to have to make an instance of myClass just to access it because that's just silly when its the same throughout all classes
also, on the issue of enums
in the class i can just type CONSTANT_ZERO and it gives me the value (which is understandable)
but the someName is pretty much redundant as its never used in the class and no one outside the class can use it as well.
so there isn't really a point to enums in obj c is there?
in objective c if i go #define MY_CONSTANT i can't access it outside of the class
i can't put anything in the @interface part because it just throws compile errors
Code:
const int MY_CONSTANT 0;
static const int MY_CONSTANT = 0;
static int MY_CONSTANT = 0;
is it possible in objective c to just go myClass.MY_CONSTANT? and if so then how am i meant to declare MY_CONSTANT in myClass? i don't want to have to make an instance of myClass just to access it because that's just silly when its the same throughout all classes
also, on the issue of enums
Code:
typedef enum {
CONSTANT_ZERO = 0,
CONSTANT_ONE = 1
} someName
but the someName is pretty much redundant as its never used in the class and no one outside the class can use it as well.
so there isn't really a point to enums in obj c is there?