enums in C (and consequently Obj-C and C++) are weakly typed, which means you can implicitly casts between enums and ints however you like as they are just ints.

For example, this is perfectly valid:

enum {A = 1};
enum {B = A+1};
const int C = A | B;

The reason the the enum uses a typedef instead of the shortform typedef enum {...} Name; is because enums defaults to being of type int. By using a typedef you can define the enum as being an unsigned integer instead.

I understand now. Thanks. That enum and that typedef are completely separated. Also I think that enums aren't always int, but depend on assigned values. Like when long number is used, as in my example, enum will be long.
–
AleksaMay 10 '12 at 11:46