title: iOS, NSMutableDictionary
body: <p>I had a problem in my project where I declared in the header file an NSMutableDictionary property like so:</p>
  
  <pre><code>@property (copy, nonatomic) NSMutableDictionary *DataDict ;
  </code></pre>
  
  <p>Now in the implementation file, I go ahead and initialise this dictionary because I am gonna use it, like so:</p>
  
  <pre><code>DataDict = [[NSMutableDictionary alloc]init];
  </code></pre>
  
  <p>Now when I did this, the minute I try to add something to this dictionary I would get this error message: </p>
  
  <blockquote>
    <p>-[__NSDictionaryI setObject:forKey:]: unrecognized selector sent to instance 0x885ae60 2012-10-19 16:51:56.040 testing[2297:c07] <em>*</em>
    Terminating app due to uncaught exception
    'NSInvalidArgumentException', reason: '-[__NSDictionaryI
    setObject:forKey:]: unrecognized selector sent to instance 0x885ae60'</p>
  </blockquote>
  
  <p>After a while and running through my project a thousand times, I decided to uncomment my initialization line, like so</p>
  
  <pre><code> //DataDict = [[NSMutableDictionary alloc]init];
  </code></pre>
  
  <p>and that fixed the problem.</p>
  
  <p>My question is: Why? </p>