title: How to add and retrieve data from NSDictionary inside a view controller
body: <p>I'm trying to cache some images in my view controller using NSDictionary but I'm not having much luck.</p>
  
  <p>for starters my .h looks like this</p>
  
  <pre><code>...
    NSDictionary *images;
  }
  
  @property (nonatomic, retain) NSDictionary *images;
  </code></pre>
  
  <p>and in my .m I synth the property and attempt to add the image as follows:</p>
  
  <pre><code>[self.images setValue:img forKey:@"happy"];
  </code></pre>
  
  <p>and later I attempt to grab the image by key </p>
  
  <pre><code>UIImage *image = [self.images objectForKey:@"happy"];
      if (!image) {
        NSLog(@"not cached");
      }else {
        NSLog(@"had cached img %@", image);
      }
  </code></pre>
  
  <p>Yet each time I NSLog the dictionary it's null. If I @synthesize the property should I be ready to go out of the box? or did I not add this to the dictionary correctly?</p>
  
  <p>Thank you in advance</p>