title: Objective C - How to return local variable in this code?
body: <p>I have the following code that works.  It successfully displays myName in the NSLog ...</p>
  
  <pre><code>NSURL *apiString = [NSURL URLWithString:@"http://testapi.com/url"];
  
  [XMLConverter convertXMLURL:apiString completion:^(BOOL success, NSDictionary *dictionary, NSError *error)
  {
      if (success)
      {
          NSString *myName = dictionary[@"profile"][@"real_name"];
          NSLog(@"%@ is my name", myName);
      }
  }];
  </code></pre>
  
  <p>I have the following code for the method convertXMLURL which is in XMLConverter.m which I imported.  It does a nice job of converting my XML to NSDictionary.  That is what I want ...</p>
  
  <pre><code>+ (void)convertXMLURL:(NSURL *)url completion:(OutputBlock)completion
  {
  ///Wrapper for -initWithContentsOfURL: method of NSXMLParser
  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
  NSXMLParser *parser = [[NSXMLParser alloc] initWithContentsOfURL:url];
  [[XMLConverter new] parser:parser completion:completion];
  });
  }
  </code></pre>
  
  <p>The problem I have is *dictionary is a local variable.  I need to use it elsewhere in the code.  How can I return it?</p>