title: Find a dictionary in ArrayOfDictionaries with a specific keyvalue pair
body: <p><strong>I have an array of dictionaries</strong></p>
  
  <pre><code>for(int i = 0; i &lt; 5; i++) {
      NSMutableDictionary *_myDictionary = [NSMutableDictionary dictionary];
  
      [_myDictionary setObject:[NSString stringWithFormat:@"%d",i] forKey:@"id"];
      [_myDictionary setObject:label.text @"Name"];
      [_myDictionary setObject:label1.text @"Contact"];
      [_myDictionary setObject:label2.text @"Gender"];
  }
  
  [_myArray addObject:_myDictionary];
  </code></pre>
  
  <p><strong>Now I want to pick a dictionary from the array whose objectForKey:@"id" is 1 or 2 or something else like there is an sql query Select * from Table where id = 2. 
  I know this process</strong></p>
  
  <pre><code>int index = [_myArray count];
  
  for(int i = 0; i &lt; 5; i++)
  {
  
  NSMutableDictionary *_myDictionary = [NSMutableDictionary dictionaryWithDictionary:[_myArray objectAtIndex:i]];
  
  if([[_myDictionary objectForKey:@"id"] isEqualToString:id])
  {
  
  index = i;
  
  return;
  
  }
  
  }
  
  if(index != [_myArray count])
      NSLog(@"index found - %i",index);
  
  else
      NSLog(@"index not found");
  </code></pre>
  
  <p>Any help would be appreciated.
  Thanks in Advance !!!</p>