title: How to update Label text when downloading Images using GCD in IOS
body: <p>I use GCD to download Images from server and updates the processing on UILabel then print the label to the screen (ex: it will print to the screen : "Downloading: 3/15 Images")</p>
  
  <p>But at the beginning the label is : "Downloading: 0/15 Images". Then when it finish downloading, the label is "Downloading: 15/15 Images".The user cant see the download processing.</p>
  
  <p>What I want is user can see the processing like: 
  "Downloading: 1/15 Images","Downloading: 2/15 Images"."Downloading: 3/15 Images",...,"Downloading: 15/15 Images".</p>
  
  <p>This is my code:</p>
  
  <pre><code> dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
          //Here your non-main thread.
          NSString *text;
  
          for (int i = 0;i&lt;[self.pageImages count];i++){
              NSString *image = [self.pageImages objectAtIndex:i];
  
              [dataManage downloadImagesFromUrl: image ];
              text = [NSString stringWithFormat:@“Downloading %d/%d”,i,self.pageImages.count];
          }
  
          dispatch_async(dispatch_get_main_queue(), ^{
              //Here you returns to main thread.
              [downloadLabel setText:text];
          });
      });
  </code></pre>