I was looking at this posting where the op says he is canceling requests in web view:shouldStartLoadWithRequest:
How to do authentication in UIWebView properly?
How is that possible? I don’t see any API on NSURLRequest to cancel it. I know its possible to cancel an NSURLConnection, if the op meant to say NSURLConnection in the posting instead of NSURLRequest, then how do you obtain the underlying NSURLConnection from within a UIWebView?
An
NSURLRequestisn’t itself a process to be canceled, so there’s no API for it. When a UIWebView sends its delegate awebView:shouldStartLoadWithRequest:message, it’s asking whether it should start the process of fetching data from / posting data to a URL — theNSURLRequestparameter is an object which simply describes that proposed action, not the object which performs it. (If UIWebView is using an underlying NSURLConnection, it hasn’t created it yet; that’s what it’s asking to do.) “Canceling the request” is simply a matter of returningNOfrom that method.