2

I try to download a large number of files >= 500 with AFNetworking 3.0 GET-request.Total load weight is approximately equal to ~ 1.7 Gb. Currently, I use:

    for (NSSttring *url in urlsArray){
        [self.sessionManager GET:file.downloadLink.absoluteString
                  parameters:nil
                    progress:^(NSProgress * _Nonnull downloadProgress) {
                        //...
                    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
                        //...
                    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
                        //....
                    }];
    }

I think, all requests and timeout timer starts immediately, but device couldn't start all this requests at the same time and pause some of them. How can I resolve this problem?

ton252
  • 364
  • 3
  • 13

1 Answers1

0

use this:

manager.operationQueue.maxConcurrentOperationCount = 4;
[manager.operationQueue addOperations:operations waitUntilFinished:NO];
Suraj Sukale
  • 1,778
  • 1
  • 12
  • 19