title: Activity Indicator View not spinning
body: <p>I have below code where I am loading some link in webview.</p>
  
  <pre><code>- (void)viewDidLoad
  {
      mySpinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
      [self openWebPage:fileName];
      [self.view addSubview:myWebView];
      [self.view addSubview:mySpinner];
      mySpinner.center = CGPointMake(self.view.frame.size.width / 2.0, 100);
  }
  
  -(void)openWebPage:(NSString*)address {
      NSURL*url=[NSURL URLWithString:address];
      NSURLRequest*request=[NSURLRequest requestWithURL:url];
      myWebView.scalesPageToFit = NO;
  
      [myWebView loadRequest:request];
  }
  
  - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
  
      UIAlertView *errorView = [[UIAlertView alloc] initWithTitle:@"Error!!!" message:@"Please make sure you are connected to 3G or Wi-Fi." delegate:nil cancelButtonTitle:@"Dismiss" otherButtonTitles:nil, nil];
      [errorView show];
      mySpinner.hidden = YES;
      [mySpinner stopAnimating];
  }
  
  
  -(void)webViewDidStartLoad:(UIWebView *)webView2 {
      NSLog(@"webViewDidStartLoad");
      mySpinner.hidden = NO;
      [mySpinner startAnimating];
      NSLog(@"step 1");
      NSDate *future = [NSDate dateWithTimeIntervalSinceNow: 2 ];
      [NSThread sleepUntilDate:future];
      NSLog(@"step 2");
  }
  
  -(void)webViewDidFinishLoad:(UIWebView *)webView2 {
      NSLog(@"webViewDidFinishLoad");
      mySpinner.hidden = YES;
      [mySpinner stopAnimating];
  
  }
  </code></pre>
  
  <p>What I am doing is at webViewDidStartLoad I am displaying spinner and starting animating using  <code>[mySpinner startAnimating];</code>, but it didn't spin. It just stays as it is (no spinning).</p>
  
  <p>Any idea what is going wrong?</p>
  
  <hr>
  
  <h2>Edit 1</h2>
  
  <p>I have webview delegate <code>@interface WebDetailsViewController : UIViewController&lt;UIWebViewDelegate&gt;</code></p>
  
  <p>Also I have added <code>[NSThread sleepUntilDate:future];</code> just to verify whether activity indicator view is animating or not.</p>
  
  <p>Below is what I have from NSLog</p>
  
  <pre><code>2013-06-23 16:29:28.843 GulfLab[2048:907] webViewDidStartLoad
  2013-06-23 16:29:28.845 GulfLab[2048:907] step 1
  2013-06-23 16:29:30.847 GulfLab[2048:907] step 2
  2013-06-23 16:29:31.836 GulfLab[2048:907] webViewDidFinishLoad
  </code></pre>
  
  <hr>
  
  <h2>Edit 2</h2>
  
  <p>Well well well the problem is in below line...</p>
  
  <pre><code>[UIView  beginAnimations: @"Showinfo"context: nil];
  [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut];
  [UIView setAnimationDuration:0.75];
  [self.navigationController pushViewController: secondView animated:NO];
  [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
  [UIView commitAnimations];
  </code></pre>
  
  <p>Below is what I have...</p>
  
  <p>One first view controller, I have buttons and when I click those button I am coming to second view controller and there I am displaying the web file based on button pressed.</p>
  
  <p>My client wanted some effect while coming to second view and for that I added above code. But because of that, I am facing the activity problem.</p>
  
  <p>Any idea what changes do I need to do?</p>
  
  <hr>
  
  <h2>On further investigation I found that problem is in this line...</h2>
  
  <pre><code>[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO];
  </code></pre>
  
  <p>but I need this line as else animation is not happening...</p>
  
  <p><strong>Also today I noticed that if I touch webview, then it starts animating</strong></p>
  
  <p>Grrr... someone help me</p>