|
|||||||
| Development XCode, Cocoa, and all other development |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
| 03-02-2009 | #1 (permalink) |
|
Operator
Join Date: Mar 2009
Location: NZ
Posts: 2
![]() |
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 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? |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|