SDWebimage - SDWebImageDownloader操作崩溃

时间:2017-07-19 11:09:56

标签: ios sdwebimage

我有代码,定期下载大量图像。代码看起来像这样

func batchProductPicsDownload() {
        for product in products {
            SDWebImageDownloader.shared().downloadImage(with: URL(string: APIMode.BackofficeRoot + product.img_url), options: [], progress: nil, completed: { (image, data, error, bool) in
                if let image = image {
                    SDWebImageManager.shared().saveImage(toCache: image, for: URL(string: APIMode.BackofficeRoot + product.img_url))
                }
            })
        }
    }

问题是我有时会崩溃

enter image description here

enter image description here

如何解决?

0 个答案:

没有答案