I am trying to get the code found here:
http://snipplr.com/view/26643/mbprogresshud-with-an-asynchronous-nsurlconnection-call/
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 statemet:
NSLog(@"float filesize: %f", [self.searchResultFileSize floatValue]); HUD.progress = [resourceLength floatValue] / [self.searchResultFileSize floatValue];
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
NSLog(@"filesize: %d", self.searchResultFileSize);
works fine. Only idea i have come up with is that it might be some threading issue??
Any ideas?? Or does anyone have a working example of how to use MBProgressHUD with asynchronous NSURLConnections?
P.S. I tried using the original MBProgressHUD code which specifies a call like:
[HUD showWhileExecuting:@selector(myProgressTask) onTarget:self withObject:nil animated:YES];
however this didnt 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.