I am creating my NSURLConnection like so:
theConnection = [[NSURLConnection alloc] initWithRequest:serviceRequest delegate:self];
I have looked in the NSURLConnection documentation and apparently the cancel API works for async requests, so will that work in the scenario?
Anyway, in my other class while the NSURLConnection is in progress I try to do this:
[mgr.theConnection cancel];
[mgr.theConnection release];
However, the delegate still gets called which I do not want. So how do I properly make sure I cancel the connection so that its delegate calls are canceled as well?
Console:
2012-08-17 23:01:11.820 app[14097:707] Will cancel connection=(null)
2012-08-17 23:01:11.821 app[14097:707] Did cancel connection
2012-08-17 23:01:11.821 app[14097:707] Did release connection
2012-08-17 23:01:20.330 app[14097:707] didReceiveResponse
2012-08-17 23:01:20.331 app[14097:707] didReceiveData
2012-08-17 23:01:20.332 app[14097:707] connectionDidFinishLoading