Find the index of the first dictionary in theArray whose value for @"name" is equal to theValue :
NSUInteger index = [theArray indexOfObjectPassingTest: ^BOOL(NSDictionary *dict, NSUInteger idx, BOOL *stop) { return [[dict objectForKey:@"name"] isEqual:theValue]; } ];
index will be NSNotFound if no matching object is found.
source share