NSURLSession
is a refactoring of NSURLConnection
and introduces some new features. I've been working on an issue with an app that uses both, and I'm wondering if this is OK. Or is it necessary to abandon NSURLConnection
methods completely when adding NSURLSession
?
Specifically, what's happening is that, seemingly randomly, a request is made and nothing is returned in response. If the webView
is asked [webView isLoading]
, the answer is YES
, however, neither connectionDidFinishLoading:
nor URLSession:didBecomeIvalidWithError:
nor webView:didFailLoadWithError:
get called. Additionally, asking the web view to stop loading using [webView stopLoading]
does not seem to work, since [webView isLoading]
seems to continue to be YES
.
If any of this sounds familiar, perhaps someone could give me suggestions of something to try. I'm running out of ideas. If NSURLConnection
cannot safely be used while NSURLSession
is being used, I'll just have to refactor to no longer use NSURLConnection
, but I'd rather not if I don't have to or if doing so doesn't solve the problem.