1

Possible Duplicate:
enum values: NSInteger or int?

What's the difference between these two enum definitions?

typedef enum : NSUInteger {
    Honda = 1,
    Chevrolet = 2,
    Mercedes = 3,
    Volvo = 4
} CarManufacturer;

and

enum {
    HarleyDavidson = 1,
    BMW = 2,
    Yamaha = 3,
    Kawasaki = 4,
};
typedef NSUInteger MotorcycleManufacturer;
Community
  • 1
  • 1
alisonc
  • 115
  • 1
  • 8

1 Answers1

0

They are essentially the same thing. The difference is that the first one is more "C++-styled" and the second one is more "C-Styled".

C++ makes some semantic differences, but you can write C-Style enums (that are present throughout the Cocoa frameworks) for backwards compatibility.

Andy Ibanez
  • 12,104
  • 9
  • 65
  • 100