title: iPhone switch statement using enum
body: <p>I have defined an enum in a header file of a class :</p>
  
  <pre><code>typedef enum{
   RED = 0,
   BLUE,
   Green
  } Colors;
  
  - (void) switchTest:(Colors)testColor;
  </code></pre>
  
  <p>and in the implementation file I have :</p>
  
  <pre><code>- (void) switchTest:(Colors)testColor{
  
     if(testColor == RED){
      NSLog(@"Red selected");    
     }
  
     switch(testColor){
      case RED:
      NSLog(@"Red selected again !");
      break;
      default:
      NSLog(@"default selected");
      break;
     }
  
  }
  </code></pre>
  
  <p>My code compiles correctly without warrnings.
  When calling the switchTest method with RED, the output is :
  "Red selected"</p>
  
  <p><strong>but once the first line of the switch runs, the application quits unexpectedly and without warrnings/errors.</strong></p>
  
  <p>I don't mind using if/else syntax but I would like to understand my mistake.</p>