I have been tasked with replacing all NSURLConnection code with AFNetworking code. I am not terribly familiar with either, one thing that puzzles me is how to replace this line:
self.urlConnection = [[NSURLConnection alloc] initWithRequest:self.urlRequest delegate:self startImmediately:true];
I have tried this:
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:self.urlRequest];
but AFHTTPRequestOperation has no delegate property. Is there an equivalent in AFNetworking that will call a delegate for NSURLConnectionDelegate methods?
AFNetworking tends towards a block based approach so you would use
setCompletionBlockWithSuccess:failure:to supply blocks to deal with the successfully received data or the failure error.