title: activity indicator on uialertview
body: <p>I have a time-consuming step to be done, if the user clicks on a certain button on an uialertview. I would like to notify the user with an activity indicator while its being done. Im not sure what exactly needs to be done for the desired output. Here is the flow:</p>
  
  <p>User clicks on button 1 'Build the tower'.</p>
  
  <p>UIAlertview shown with "Do you want to do this, it takes time"</p>
  
  <p>User clicks "YES":
  Now I am in the alertview Delegate method.</p>
  
  <pre><code>-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
  
  if (buttonIndex == 1) {//Yes the user wants to do this
   //Show activity indicator here
  
      UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc]     initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
  
      indicator.center = CGPointMake(alert.bounds.size.width / 2, alert.bounds.size.height - 50);
      [indicator startAnimating];
      [alertView addSubview:indicator];
      [indicator release];
  
  //
  [SimpleFunctions doThatMethodThatTakesALongTime];
   //remove activity indicator here
  
      }
  
  }
  </code></pre>
  
  <p>Here, I want to show an activity indicator before the 'big processing' is done.</p>
  
  <p>The examples of adding an activity indicator to alertview show how to add the indicator to the above alertview. But I don't want that indicator to show up, until the user has clicked on 'YES'. 
  Any pointers on how that can be achieved would be great. I hope I made the question clear, please let me know if not,</p>
  
  <p>Thanks</p>