I have an NSURLConnection that works fine when I allow the download to complete. But if the user clicks the back button, that is, the webview will disappear, I want to cancel the NSURLConnection. But if you have a webview call to this class when viewWillDissapear is called, then I do:
[conn cancel]
I get an NSINValidArgument exception.
A connection is defined as instance data in a .h file as:
NSURLConnection *conn;
This is where async is triggered:
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:articleURL]]; if ([NSURLConnection canHandleRequest:request] && reachable) {
source share