我有一个 UIImageView。此 imageView 的图像是从 Web 加载的。有人可以告诉我如何停止加载吗?
这是我的代码:
UIImageView *currentImgView = (UIImageView *)[self.scrollView viewWithTag:self.pageControl.currentPage + 500];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
UIImage *newImg = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[[[self.imagesStructure valueForKey:DATA_PARAMETER] objectAtIndex:self.pageControl.currentPage] valueForKey:@"source"]]]];
dispatch_async(dispatch_get_main_queue(), ^{
currentImgView.image = newImg;
[self hideActivityView];
});
});