title: Fetch common elements from NSArray of dictionaries based on the value for key
body: <p>I have NSMutableArray of NSDictionaries. Here's the array.</p>
  
  <pre><code>Month records (
      {
      BMI = "209.75";
      Date = "15/07/2014 09:03 AM";
      Height = 42;
      Weight = 37;
      day = 15;
      month = 7;
      year = 2014;
  },
      {
      BMI = "366.67";
      Date = "21/07/2014 09:03 AM";
      Height = 30;
      Weight = 33;
      day = 21;
      month = 7;
      year = 2014;
  },
      {
      BMI = "831.02";
      Date = "15/07/2014 09:04 AM";
      Height = 19;
      Weight = 30;
      day = 15;
      month = 7;
      year = 2014;
  }
  )  
  </code></pre>
  
  <p>Now I want to fetch the elements of same "day" (as per here, there are 2 elements of "day=15" and 1 element of "day=7"). Then calculate the average BMI value for that particular day.</p>
  
  <p>In general, my requirement is to fetch common elements(based on a value for key) and put them in a new array. What is the best way to do this at the runtime with a large data set.</p>