title: GCD cancel async block?
body: <p>I have regular code for loading images in table view cells </p>
  
  <pre><code>    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
          NSImage *image = file.image;
          dispatch_async(dispatch_get_main_queue(), ^{
              imageView.image = image;
          });
      });
  </code></pre>
  
  <p>The problem is when I scroll too fast I can see that last block fires several times on same <code>imageView</code>. And that looks really weird. Is there any way to cancel all previously scheduled operations for one <code>imageView</code> (lets say they all will have unique id) before scheduling new one? </p>
  
  <p>I mean, I want to be sure that only last scheduled operation should be executed and all all previously scheduled should be dropped. Is that possible by means of <code>Grand Central Dispatch</code>? Or I have to add my own atomic flags to imageView objects and check whether flags are set before calling <code>imageView.image = image;</code></p>