title: Expected method to read dictionary element not found on object of type "class"
body: <p>I'm trying to implement keyed subscripting for a custom class in Objective-C:</p>
  
  <p>This is what I have in the header:</p>
  
  <pre><code>- (id)objectAtKeyedSubscript:(id &lt;NSCopying&gt;)key;
  </code></pre>
  
  <p>And this is what I have in the implementation:</p>
  
  <pre><code>- (id)objectAtKeyedSubscript:(id &lt;NSCopying&gt;)key
  {
      id result = self.attributes[key];
      return result;  
  }
  </code></pre>
  
  <p>I use it like so:</p>
  
  <pre><code>element[@"href"];
  </code></pre>
  
  <p>where before I did:</p>
  
  <pre><code>[element objectForKey:@"href"];
  </code></pre>
  
  <p>where objectForKey was being implemented like so:</p>
  
  <pre><code>- (NSString *) objectForKey:(NSString *) theKey
  {
      return [[self attributes] objectForKey:theKey];
  }
  </code></pre>
  
  <p>Something I'm missing? Doing wrong?</p>