title: Using MBProgressHUD with asynchronous NSURLConnection?
body: <p>I am trying to get the code found here:</p>
  
  <p><a href="http://snipplr.com/view/26643/mbprogresshud-with-an-asynchronous-nsurlconnection-call/" rel="nofollow noreferrer">http://snipplr.com/view/26643/mbprogresshud-with-an-asynchronous-nsurlconnection-call/</a></p>
  
  <p>to work in my project. It's using the private MBProgressHUD class however i keep getting exc_bad_access errors on lines 69 or 70 depending if you comment out the log statement:</p>
  
  <p>NSLog(@"float filesize: %f", [self.searchResultFileSize floatValue]);
  HUD.progress = [resourceLength floatValue] / [self.searchResultFileSize floatValue];</p>
  
  <p>The problem is with the conversion of searchResultFileSize to a floatValue although i cant figure out why. A call to the same variable one line up</p>
  
  <p>NSLog(@"filesize: %d", self.searchResultFileSize);</p>
  
  <p>works fine. Only idea i have come up with is that it might be some threading issue??</p>
  
  <p>Any ideas?? Or does anyone have a working example of how to use MBProgressHUD with asynchronous NSURLConnections?</p>
  
  <p>P.S. I tried using the original MBProgressHUD code which specifies a call like:</p>
  
  <p>[HUD showWhileExecuting:@selector(myProgressTask) onTarget:self withObject:nil animated:YES];</p>
  
  <p>However this didn't work because myProgressTask uses a NSURLConnection which is uses a delegate so the code above would execute for the method call to myProgressTask and then hide itself before the response came back.</p>