enum Pet {Cat, Dog, Bird};
How should the prototype for a function that takes this as an argument
look? The following produced errors:
- (NSString) enumToString: (Pet) pet
error: syntax error before 'Pet'
- (NSString) enumToString: (enum Pet) pet
error: can not use an object as parameter to a method
Incidentally, I'm doing this to convert the enum's value into an
NSString.
It's not the enum (the second variant should work BTW), its the return
type being NSString instead of an "NSString *".
> - (NSString) enumToString: (Pet) pet
> error: syntax error before 'Pet'
Try the above with a typedef.