title: Completion handlers and return values
body: <p>I want to call a method which will return a value from its completion handler. The method performs asynchronously and I don't want to return a value before all the body of the method has been executed. Here is some <strong>faulty</strong> code to illustrate what I am trying to achieve:</p>
  
  <pre><code>// This is the way I want to call the method
  NSDictionary *account = [_accountModel getCurrentClient];
  
  // This is the faulty method that I want to fix
  - (NSDictionary *)getCurrentClient
  {
      __block NSDictionary *currentClient = nil;
      NXOAuth2Account *currentAccount = [[[NXOAuth2AccountStore sharedStore] accounts] lastObject];
  
      [NXOAuth2Request performMethod:@"GET"
                          onResource:[NSURL URLWithString:[NSString stringWithFormat:@"%@/clients/%@", kCatapultHost, currentAccount.userData[@"account_name"]]]
                      usingParameters:nil
                          withAccount:currentAccount
                  sendProgressHandler:nil
                      responseHandler:^ (NSURLResponse *response, NSData *responseData, NSError *error) {
                          NSError *jsonError;
  
                          currentClient = [NSJSONSerialization JSONObjectWithData:responseData
                                                                          options:kNilOptions
                                                                              error:&amp;jsonError];
                      }];
  
      return currentClient;
  }
  </code></pre>
  
  <p>I don't want the <code>getCurrentClient</code> method to return a value until the <code>NXOAuth2Request</code> has finished. I can't return the current client inside the response handler of the request either. So what are my options?</p>