[Solved] Objective-C, How to count the number of TRUE booleans? [duplicate]
[ad_1] To Understand as Simple manner: int trueCount = 0; int falseCount = 0; for (<#initialization#>; <#condition#>; <#increment#>) { BOOL test3 = [test containsCoordinate:tg]; if (test3) { trueCount++; } else{ falseCount++; } } NSLog(@”True : %i”,trueCount); NSLog(@”False : %i”,falseCount); Implementation: -(void)markers{ NSURL *url = [NSURL URLWithString:@”http://example.com/api/s.php”]; data = [NSData dataWithContentsOfURL:url]; NSError *error; NSMutableArray *array = … Read more