title: NSArray of many NSDictionary. What is the best way to find a NSDictionary with necessary value for given key?
body: <p>Now I'm trying the following and it works. </p>
  
  <pre><code>
      - (void)findDictionaryWithValueForKey:(NSString *)name {
  
           for (NSDictionary * set in myArray) {
  
              if ([[set objectForKey:@"title"] isEqualToString:name]) 
                 \\do something
  
           }
  
      }
  </code></pre>
  
  <p><strong>EDIT:</strong>
  I've added one extra argument to the post of <strong>bshirley</strong>. Now it looks more flexible.</p>
  
  <pre><code>
  
  - (NSDictionary *)findDictionaryWithValue:(NSString*)name forKey:(NSString *)key {
  
      __block BOOL found = NO;
      __block NSDictionary *dict = nil;
  
      [self.cardSetsArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
          dict = (NSDictionary *)obj;
          NSString *title = [dict valueForKey:key];
          if ([title isEqualToString:name]) {
              found = YES;
              *stop = YES;
          }
      }];
  
      if (found) {
          return dict;
      } else {
          return nil;
      }
  
  }
  </code></pre>