title: Async call in Objective-C
body: <p>I'm trying to get data from a website- xml. Everything works fine.</p>
  
  <p>But the UIButton remains pressed until the xml data is returned and thus if theres a problem with the internet service, it can't be corrected and the app is virtually unusable.</p>
  
  <p>here are the calls:</p>
  
  <pre><code>{
      AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
      if(!appDelegate.XMLdataArray.count &gt; 0){
          [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
          [appDelegate GetApps]; //function that retrieves data from Website and puts into the array - XMLdataArray.
      }
      XMLViewController *controller = [[XMLViewController alloc] initWithNibName:@"MedGearsApps" bundle:nil];
      [self.navigationController pushViewController:controller animated:YES];
      [controller release];
  }
  </code></pre>
  
  <p>It works fine, but how can I make the view buttons functional with getting stuck. In other words, I just want the UIButton and other UIButtons to be functional whiles the thing works in the background. </p>
  
  <p>I heard about <code>performSelectorInMainThread</code> but I can't put it to practice correctly.</p>