-(void)setModel:(CLModel*)model{
? ? _model= model;
? ? __blockUIImage*placeholderImage = [UIImageimageNamed:@"placeholder"];
? ? [[SDWebImageManager sharedManager] cachedImageExistsForURL:[NSURL URLWithString:_model.pictureUrl] completion:^(BOOL isInCache) {
? ? ? ? if(isInCache) {
? ? ? ? ? ? //本地存在圖片,替換占位圖片
? ? ? ? ? ? placeholderImage = [[SDImageCache sharedImageCache] imageFromDiskCacheForKey:model.pictureUrl];
? ? ? ? }
? ? ? ? //主線程
? ? ? ? dispatch_async(dispatch_get_main_queue(), ^{
? ? ? ? ? ? [self.IMGView sd_setImageWithURL:[NSURL URLWithString:model.pictureUrl] placeholderImage:placeholderImage];
? ? ? ? });
? ? }];
}