异步下载图片用的是 SDWebImage框架,要做到图片下载完成以后,再去休息imageView的一些属性,我用的这个方法:如下 ShowPhotoView* t = [[ShowPhotoView alloc] init];
[t.imageView setImageWithURL:url placeholderImage:[UIImage imageNamed:@"icon_nologin"] options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) {
t.InfoDic = dict[@"info"]; //这句话即修改t的属性。问题是,这里面只要出现t的话,就警告Capturing 't' strongly in this block is likely to lead to a retain chycle.
}];这个项目是ARC,我尝试用 __weak ShowPhotoView* t;但这样也不行,t过早释放了。求大神指点,谢谢。
[t.imageView setImageWithURL:url placeholderImage:[UIImage imageNamed:@"icon_nologin"] options:0 progress:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) {
t.InfoDic = dict[@"info"]; //这句话即修改t的属性。问题是,这里面只要出现t的话,就警告Capturing 't' strongly in this block is likely to lead to a retain chycle.
}];这个项目是ARC,我尝试用 __weak ShowPhotoView* t;但这样也不行,t过早释放了。求大神指点,谢谢。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货