title: Assign a variable inside a Block to a variable outside a Block
body: <p>I'm getting an error </p>
  
  <blockquote>
    <p>Variable is not assignable (missing __block type specifier)</p>
  </blockquote>
  
  <p>on the line <code>aPerson = participant;</code>. How can I make sure the block can access the <code>aPerson</code> variable and the <code>aPerson</code> variable can be returned?</p>
  
  <pre><code>Person *aPerson = nil;
  
  [participants enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {   
      Person *participant = (Person*)obj;
  
      if ([participant.gender isEqualToString:@"M"]) {
          aPerson = participant;
          *stop = YES;
      }
  }];
  
  return aPerson;
  </code></pre>