As Chuck says, use -[NSArray containsObject:[NSNumber numberWithBool:YES]] . As a thought experiment, here are some other ways to achieve your goal ...
You can do this using NSPredicate or using the new blocks API:
NSArray *myArr //decleared, initialized and filled BOOL anyTrue = [myArray filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"boolValue == 1"]].count > 0;
or
BOOL anyTrue = [myArray indexesOfObjectsPassingTest:^(id obj, NSUInteger idx, BOOL *stop) { if([obj boolValue]) { *stop = YES; } return [obj boolValue]; }].count > 0;
You can also use Key-Value encoding, although I'm not sure about its relative effectiveness:
[[myArray valueForKeyPath:@"@sum.boolValue"] integerValue] > 0;
Barry wark
source share