UIActivityIndicator issue when downloading from URL
<p>I'm trying to download the picture from URL and use a activity indicator animating to present the fact that the file is downloading. However, it is not working as my indicator isn't animating when I call this download function, can somebody tell me why?       </p>

<pre><code>-(void)download{
    [indicator startAnimating];
    NSString *downloadPath=@"http://www.xyz.com/path/pic.jpg; 
    NSData *downloadData=[NSData dataWithContentsOfURL:[ NSURL  URLWithString:downloadPath]];
    if(downloadData){
           //do something
          [indicator stopAnimating];
     }
      else{
        //do something
        [indicator stopAnimating];
          }
     }
</code></pre>
