Alternative for enqueueHTTPRequestOperation in AFNetworking 2.0

We must upload files at the same time in our application.

In an earlier version of AFNetworking, we uploaded 2 files at once using the following code:

(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 use AFHTTPRequestOperationManager and can set

  setMaxConcurrentOperationCount: value 

But we manually start the boot process. I am looking for an alternative (enqueueHTTPRequestOperation in 2.0) to download it automatically.

+5
ios objective-c afnetworking-2
source share
1 answer

I found the operationQueue property in AFHTTPRequestOperationManager

So try this

 [self.operationQueue addOperation:downloadObj.downloadOperation]; 
+6
source

All Articles