title: In Objective-C Check an array of Boolean Values and see if at least ONE is YES
body: <p>I have a mutable array of Boolean values and I want to check to see if ANY of the values are YES.</p>
  
  <p>At present I am creating another array alongside this one which is always ALL False like so;</p>
  
  <pre><code> [MyArray addObject:[NSNumber numberWithBool:switchInput]];
   [MyAllNoArray addObject:[NSNumber numberWithBool:NO]];
  </code></pre>
  
  <p>The user does some bits and the some of the objects in MyArray may become YES, I then use the below to see if ANY are true or not.</p>
  
  <pre><code>if([MyArray isEqualToArray:MyAllNoArray])
  </code></pre>
  
  <p>I am just wondering if there is a better way (this way seems wasteful)?</p>
  
  <p>I have thought about a counter, each time one of the objects changes the counter goes up or down (depending on changing to YES or NO), if the counter is 0 then so is the array.  But I am just thinking there may be a better way within an IF statement that I am missing.</p>