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]]];
});