title: How to iterate throw typedef enum in Objective-C?
body: <p>I'm developing an iOS application with latest SDK.</p>
  
  <p>I have this enum:</p>
  
  <pre><code>typedef enum BoxTypeValues {
      Speed,
      FPS,
      Altitude,
      Location,
      Accuracy
  } BoxType;
  </code></pre>
  
  <p>And I want to iterate throw all of its values and convert them to <code>NSString</code>.</p>
  
  <p>I'm doing it this way, but it is very hard coded:</p>
  
  <pre><code>+ (NSArray*)BoxTypeValues
  {
      return [NSArray arrayWithObjects:@"Speed", @"FPS", @"Altitude", @"Location",
              @"Accuracy", nil];
  }
  
  + (NSString*)BoxTypeToString:(BoxType)aType
  {
      NSString* result = nil;
  
      switch (aType)
      {
          case Speed:
              result = @"Speed";
              break;
          case FPS:
              result = @"FPS";
              break;
          case Altitude:
              result = @"Altitude";
              break;
          case Location:
              result = @"Location";
              break;
          case Accuracy:
              result = @"Accuracy";
              break;
  
          default:
              break;
      }
      return result;
  }
  </code></pre>
  
  <p><strong>Any advice?</strong></p>