title: Using class as key in NSDictionary
body: <p>I'm writing a contextual "factory" that will maintain a dictionary of converter/acting objects which inherit from some Converter class. This class has a method:</p>
  
  <pre><code>- (Class)classResponsibility
  </code></pre>
  
  <p>Or something similar, such that a StringConverter class would implement the method as:</p>
  
  <pre><code>- (Class)classResponsibility {
      return [NSString class];
  }
  </code></pre>
  
  <p>Then to store that converter in the dictionary, I had hoped on doing something like:</p>
  
  <pre><code>[converters setValue:stringConverter forKey:[stringConverter classResponsibility]];
  </code></pre>
  
  <p>But the compiler complains that the type "Class" is an invalid parameter type for argument 2 of the setValue:forKey: method. I had wanted to avoid setting the key as the Class's name ("NSString"), but if that's the best solution than I'll go with it.</p>