5

We need to download files concurrently in our application.

In earlier version of AFNetworking we have downloaded 2 files concurrently by using the code below:

(AFHTTPClient)
[_httpClient.operationQueue setMaxConcurrentOperationCount:MAX_CONCURRENT_OPERATIONS];
[self.httpClient enqueueHTTPRequestOperation:downloadObj.downloadOperation];  

Now we want to upgrade our AFNetworking to 2.0.

Instead of AFHTTPClient we are using AFHTTPRequestOperationManager and able to set

  setMaxConcurrentOperationCount: value 

But we are manually starting our download process. I am looking for alternative(enqueueHTTPRequestOperation in 2.0) for this to download automatically.

Angew is no longer proud of SO
  • 167,307
  • 17
  • 350
  • 455
Konda
  • 123
  • 1
  • 10

1 Answers1

6

I found the property operationQueue in AFHTTPRequestOperationManager

So maybe try this

[self.operationQueue addOperation:downloadObj.downloadOperation];
xialin
  • 7,686
  • 9
  • 35
  • 66
  • i used this, download starting automatically but,even after setting the setMaxConcurrentOperationCount: all the downloads are starting at a time. – Konda Mar 10 '14 at 06:42