博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SDWebImage crash CFRunLoopRun(); crash #1262
阅读量:2396 次
发布时间:2019-05-10

本文共 1413 字,大约阅读时间需要 4 分钟。

转载自: https://github.com/rs/SDWebImage/issues/1262

Hi, we came to the same issue with the latest version(3.7.3), when scrolling the Cells of UITableView very fast. randomly the scrolling may be frozen.
We invoke SDWebImage like this:

- (void)configureImageWitURL:(NSURL *)imageURL{    @weakify(self);    [self sd_setImageWithURL:imageURL placeholderImage:nil options:SDWebImageRetryFailed progress:^(NSInteger receivedSize, NSInteger expectedSize) {        @strongify(self);        [self.progressView setProgress:receivedSize / (float)expectedSize];    } completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {        @strongify(self);        self.progressView.hidden = YES;        if (cacheType != SDImageCacheTypeMemory) {            self.alpha = 0;            [UIView animateWithDuration:0.3 animations:^{                self.alpha = 1;            }];        }    }];}

I think that there is a bug in SDWebImage: progress block gets called on background thread.

try to call the body of the progress block method using dispatch_async:

dispatch_async (dispatch_get_main_queue(), ^{


(self);
[self.progressView setProgress:receivedSize / (float)expectedSize];
});

 commented 

 I tried dispatch_async, and it seems problem solved, (Though I'm not very certain of that, because this happened randomly, but I haven't came to that problem since change the code withdispatch_async). Thanks

你可能感兴趣的文章
Salesforce将成为按需世界的微软吗?(转)
查看>>
程序员面试之葵花宝典
查看>>
阿里巴巴2008校园招聘在线宣讲会
查看>>
SaaS会议记录
查看>>
求职的旅程
查看>>
测试绝非低等
查看>>
Architecture Strategies for Catching the Long Tail (转)
查看>>
SAAS相关技术要点整理(转)
查看>>
防范SaaS模式下电子财务的风险(转)
查看>>
读书笔记-《J2EE核心模式》
查看>>
SaaS在中国抓住“长尾”需特殊商业模式(转)
查看>>
浅谈SaaS系统中的数据模型设计(转)
查看>>
CIO慎实施:SaaS无法解决“关键”问题?
查看>>
SaaS炒作似乎过了头 怀疑论接踵而来(转)
查看>>
使用SaaS模式应规避四大风险(转)
查看>>
国内热门的开放平台
查看>>
SaaS安全技术与最新进展
查看>>
SaaS开始在全球普及
查看>>
软件产业裂变 SaaS生态渐成
查看>>
颠覆传统运营模式 SaaS搅动中国软件产业
查看>>