Token for using enum data type using NSLog

Viewed 3417

I am trying to display the value stored a particular value of enum using NSLog. In the following example, I am trying to get the output as: 5 represents month of May.

Any idea what is the right token to use for enum with NSLog? I tried using %i and %@, but both do not work.

Thanks!

enum month {jan = 1, feb, march, apr, may, jun, jul, aug, sep, oct, nov, dec};
enum month amonth;
int x = 5;
amonth = x;
NSLog(@"%i represents month of %@", x,amonth);
1 Answers
Related