title: Creating NSDictionary with keys that have multiple values
body: <p>I have a mutable array that contains <code>NSDictionary</code> dic1 objects, </p>
  
  <p>each dictionary has a key called  <code>contactId</code>, more than one dictionary can have the same value for <code>contactId</code>.</p>
  
  <p>What I want to do is to create an <code>NSDictionary</code> with unique <code>contactIds</code> as the keys and an array value that contains a list of all <code>NSDictionary</code> dic1 objects that have the value <code>contactId</code> equal to the key.</p>
  
  <p>How can I do this?</p>
  
  <p>My data looks like this:</p>
  
  <pre><code>**myArray**:[  **dic1** {contactId = x1 , name = name1 }, **dic2**{contactId = x2, name = 
  name2 }, **dic3**{contactId = x1, name = name3} ]
  </code></pre>
  
  <p>I want it to become like this: </p>
  
  <pre><code>**NSDictionary**: { **x1**:[dic1, dic3], **x2**:[dic2] } 
  </code></pre>