1
votes

I recently upgraded to AFNetworking 2.0, and as a larger app rewrite, I am trying to refactor a portion of my code responsible for downloading multiple images. With my new code, I also want to be able to monitor the progress of the batch of downloads as opposed to each individual image.

Using AFNetworking 1.0, my old code added a bunch of AFImageRequestOperations to an NSOperationQueue and then I just let that run.

My understanding is that, while not deprecated yet, we should be moving away from anything related to NSURLConnection and instead rely on NSURLSession. Using AFURLSessionManager I can't figure out how to enqueue a bunch of tasks and be able to monitor the progress of all tasks collectively. I only see how to fire off one task at a time.

For something like this are we still supposed to rely on NSURLConnection/AFHTTPRequestOperation, or am I missing something in AFNetworking 2.0's documentation?

1
check out stackoverflow.com/questions/20202350/… my answer about using AFHTTPClient to perform batch downloadsPatrick Goley
thanks for the quick response @PatrickGoley. I'm using AFNetworking 2.0 which doesn't include AFHTTPClient. Any ideas on how to do the same thing with 2.0?djibouti33

1 Answers

1
votes

Bummer. Just found this a response by Mattt on Github: https://github.com/AFNetworking/AFNetworking/issues/1504#issuecomment-27071821

In short, right now we have to rely on AFHttpRequestOperations, as NSURLSessionTasks have limitations when working in batches.