title: Subclassing NSMutableDictionary
body: <p>I am trying to implement a subclass of NSMutableDictionary that returns nil instead of throwing a NSUndefinedKeyException when the key is not present in the Dictionary.</p>
  
  <p>However when I try to add objects to my dictionary I get </p>
  
  <pre><code>[NSMutableDictionary setObject:forKey:]: method only defined for abstract class
  </code></pre>
  
  <p>NilDictionary.h</p>
  
  <pre><code>@interface NilDictionary : NSMutableDictionary {
  } 
  @end
  </code></pre>
  
  <p>NilDctionary.m</p>
  
  <pre><code>@implementation NilDictionary
  - (id)valueForUndefinedKey:(NSString *)key {
    return nil;
  }
  @end
  </code></pre>
  
  <p>Do I really have to implement all the methods from NSMutableDictionary again in my subclass or is there some other class I should be subclassing?</p>
  
  <p><strong>Clarification</strong>: My original problem came down to me not being able to read the documentation properly. </p>
  
  <p>If you need to subclass NSMutableDictionary check out the correct answer. If you want a dictionary that returns nil when your key is not present, NSMutableDictionary does that already.</p>