title: counter inside enumerateObjectsUsingBlock
body: <p>I need to iterate through an <code>NSArray</code> to calculate some metrics (total height). Here's my code:</p>
  
  <pre><code>__block CGFloat height = someInitialValue;
  
  [messages enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
      if (condition1)
          height += someValue;
  
      if (condition2)
          height += someValue;
  }];
  </code></pre>
  
  <p>Each iteration starts with <code>height = someInitialValue</code>. But I want to continually increase <code>height</code>. Is it possible to calculate the total height with block-enumeration or do I have to use fast enumeration?</p>