ios 图片处理-内存疯长的解决办法

2021-12-18  本文已影响0人  一代枭雄

#pragma mark --- 高分辨率的图片禁止图片解压缩操作

[[SDImageCache sharedImageCache] setShouldDecompressImages:NO]; [[SDWebImageDownloader sharedDownloader] setShouldDecompressImages:NO]; SDImageCache *canche = [SDImageCache sharedImageCache]; canche.shouldDecompressImages = NO; SDWebImageDownloader *downloder = [SDWebImageDownloader sharedDownloader]; downloder.shouldDecompressImages = NO;

-(void)dealloc {

    SDImageCache *canche = [SDImageCache sharedImageCache];

    canche.shouldDecompressImages = YES;

    SDWebImageDownloader *downloder = [SDWebImageDownloader sharedDownloader];

    downloder.shouldDecompressImages = YES;

}

上一篇下一篇

猜你喜欢

热点阅读