Is there a concise way to map a string to an enum in Objective-C?
- by zekel
I have a string I want to parse and return an equivalent enum. I need to use the enum type elsewhere, and I think I like how I'm defining the class. The problem is that I don't know a good way to check the string against the enum values without being redundant about the order of the enums.
typedef enum {
ZZColorRed,
ZZColorGreen,
…