title: typedef enum type as key to NSDictionary?
body: <p>Are enums not allowed as keys for an NSMutableDictionary?</p>
  
  <p>When I try to add to the dictionary via:</p>
  
  <pre><code>[self.allControllers setObject:aController forKey:myKeyType];
  </code></pre>
  
  <p>I get the error:</p>
  
  <blockquote>
    <p>error: incompatible type for argument
    2 of 'setObject:forKey:'</p>
  </blockquote>
  
  <p>Typically, I use NSString as my key name which doesn't require a cast to 'id' but to make the error go away, I had do that. Is the casting the correct behavior here or are enums as keys a bad idea?</p>
  
  <p>My enum is defined as:</p>
  
  <pre><code>typedef enum tagMyKeyType
  {
    firstItemType = 1,
    secondItemType = 2
  } MyKeyType;
  </code></pre>
  
  <p>And the dictionary is defined and properly allocated as such:</p>
  
  <pre><code>NSMutableDictionary *allControllers;
  
  allControllers = [[NSMutableDictionary alloc] init];
  </code></pre>