title: Download one file at a time using afnetworking
body: <p>I have an <code>array</code> which contains different URLs. I want to download one file with a progress bar, than start the next one and so on.</p>
  
  <p>Here is my code that I have so far;</p>
  
  <pre><code>-(void) func:(NSArray *) arry
  {
  
      NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
      configuration.timeoutIntervalForRequest = 900;
      AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:configuration];
  
      NSMutableArray * downloadedUrl = [[NSMutableArray alloc] init];
      for (NSString * str in arry) {
          NSURL *URL = [NSURL URLWithString:str];
          NSURLRequest *request = [NSURLRequest requestWithURL:URL];
  
          NSURLSessionDownloadTask downloadTask = [manager downloadTaskWithRequest:request progress:nil destination:^NSURL (NSURL targetPath, NSURLResponse response) {
               NSURL *tmpDirURL = [NSURL fileURLWithPath:NSTemporaryDirectory() isDirectory:YES];
  
               return [tmpDirURL URLByAppendingPathComponent:[response suggestedFilename]];
          } completionHandler:^(NSURLResponse response, NSURL filePath, NSError *error) {
  
              if(error)
              {
                  NSLog(@"File Not Dowloaded %@",error);
  
              }
  
          }];
          [downloadTask resume];
      }
  }
  </code></pre>
  
  <p>How would you download one file at a time with a progress bar and then remove the url from array?</p>