title: Objective-c: NSString to enum
body: <p>So, I've got this definition:</p>
  
  <pre><code>typedef enum {
      red = 1,
      blue = 2,
      white = 3
  } car_colors;
  </code></pre>
  
  <p>Then, I've got a variable of type car_colors:
  car_colors myCar;</p>
  
  <p>The question is, I receive the color of the car in a NSString. It must be a NSString, I can't change that. How can I convert from NSString to car_colors type?</p>
  
  <pre><code>NSString *value = [[NSString alloc] initWithString:@"1"];
  myCar = [value intValue]; // &lt;-- doesn't work
  </code></pre>
  
  <p>any idea?
  thanks!</p>