title: Make iOS blocks execute synchronously
body: <p>How can I make a block execute synchronously, or make the function wait for the handler before the return statement, so the data can be passed back from the block?</p>
  
  <pre><code>-(id)performRequest:(id)args
  {
  __block NSData *data = nil;   
  
      [xyzclass requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) {
          data = [NSData dataWithData:responseData];
      }];
  
      return data;
  }
  </code></pre>