title: objective-c dictionary access as property/method
body: <p>In my obj-c class, I have a dictionary mapping strings to objects. </p>
  
  <pre><code>NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
      @"value1", @"key1", @"value2", @"key2", nil];
  MyClass* obj = [[MyClass alloc] initWithDictionary:dict];
  </code></pre>
  
  <p>Now, instead of doing:</p>
  
  <pre><code>NSString* val1 = [obj value:@"key1"];
  </code></pre>
  
  <p>I want to do:</p>
  
  <pre><code>NSString* val1 = [obj key1];  // @"value1"
  NSString* val2 = [obj key2];  // @"value2"
  NSString* val3 = [obj key3]; // nil, not found
  </code></pre>
  
  <p>Is it possible? </p>
  
  <p>Of course this assumes that (a) dictionary keys are valid identifier names; and (b) there are no "real" properties/methods with the same name (this would probably call the real method instead).</p>