title: Bidirectional Map in Cocoa
body: <p>Cocoa provides NSDictionary, which essentially is an associative array.</p>
  
  <p>Is there a nice way to get bidirectional associativity? i.e. one way would have been if NSDictionary had a <code>keyForObject:</code> method which mirrored the behavior of <code>objectForKey:</code>.</p>
  
  <p>I don't really care if NSDictionary is not the way to get this. I know NSDictionary <em>does</em> provide <code>keysOfEntriesPassingTest:</code> but it returns an <code>NSSet *</code> which doesn't look very clean for the kind of thing I want to have.</p>
  
  <p>Here is an example:</p>
  
  <pre><code>fieldMap = [[NSDictionary alloc] initWithObjectsAndKeys:
      @"c0",@"synckey",
      @"c1",@"wi_id",
      @"c2",@"wi_parent_id",
      @"c3",@"wi_type",
      @"c4",@"wi_rh_task",
      @"c5",@"decision_key",
      @"c6",@"wi_stat",
      @"c7",@"wi_prio",
      @"c8",@"wi_cd",
      @"c9",@"wi_ct",
      @"cb",@"wi_dh_stat",
      @"cc",@"wi_user",
      nil];
  </code></pre>
  
  <p>I want to translate between <em>c0</em> and <em>synckey</em> and back, and ditto for the other fields.</p>