【发布时间】:2012-11-28 22:48:29
【问题描述】:
我正在使用SDWebImage 库,图像大小约为 0.5 MB,点击UITableViewCell 时显示在detailView。
详细视图中的代码:
- (void)configureView
{
if (self.imageURL)
{
[self.imageView setImageWithURL:self.imageURL placeholderImage:nil options:SDWebImageProgressiveDownload progress:^(NSUInteger receivedSize, long long expectedSize)
{
float percentDone = (float)receivedSize*200/(receivedSize+expectedSize);
[SVProgressHUD showWithStatus:[NSString stringWithFormat:@"Downloading... %0.0f%%", percentDone]];
if (percentDone == 100) {
[SVProgressHUD showSuccessWithStatus:@"Loaded."];
}
}
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType)
{
}];
}
}
- (void)viewDidLoad
{
[super viewDidLoad];
[self configureView];
}
图像是否太大(半兆字节)?
SDWebImage 缓存这些图片。
【问题讨论】:
-
尝试评论 [SVProgressHUD showWithStatus:[NSString stringWithFormat:@"Downloading... %0.0f%%", percentDone]];
-
我马上给它,一秒钟重现崩溃
-
没有崩溃日志,只有几次:收到内存警告。然后应用关闭
-
@MikhailViceman,我试图评论该行,内存警告和崩溃仍然发生。顺便说一句,崩溃不会在第一个图像显示时发生,但在几次之后。
-
确保在关闭详细视图后发布图片
标签: iphone ios memory crash sdwebimage