0

I have a queue that is responsible to download images for a table view, and i want to stop this queue when the table view is reloaded or i segue to a new view controller. I have tried to do some sort of verification inside the block but none seem to work.

if(!ImageQueue){
    ImageQueue = dispatch_queue_create("com.loadimages", NULL);
}

dispatch_async(ImageQueue, ^{

    UIImage * image = [UIImage imageWithData:[NSData dataWithContentsOfURL:
                                             [NSURL URLWithString: urlString]]];


});
rob180
  • 901
  • 1
  • 9
  • 29
  • There are already posts of how to suspend and cancel a GCD queue (http://stackoverflow.com/questions/6737044/suspending-gcd-query-problem/6737719#6737719). Alternatively, you could us an NSOperation. – Joseph DeCarlo Nov 27 '14 at 14:07
  • i have tried but i did not quiet understood how it worked – rob180 Nov 27 '14 at 15:51

0 Answers0