#define vs global variables


#1

I do not really understand why you should better use global variables and enum for constants instead of #define.
I know they are easier to work with while debugging, but that’s it.
Why can’t you use == for a #define constant? I tried it, and it worked?
Thanks!


#2

As I understand it, #define is from the standard C library. And global variables are commonly used in obj-C.
Because obj C is built upon C , all C things work in objC. That explains why #define works in your code.

I presume that it is not a question of working or not, may be it is only convention, or programming style. If there is more to it, I think we will find out later.
If you need indepth info, I hope someone else can provide it. :wink: