ios - 将 SDWebImage 与解析一起使用

标签 ios swift memory sdwebimage

在很多人的指点下,我安装了SDWebImage,因为我原来有很多内存警告。我没有对我的图像使用 NSCache,这有助于在我的单元格出队时从 Parse 数据填充我的 Collection View ,我尝试了 SDWebImage 的内存缓存。除了 URL 方法之外,我还能从 SDWebImage 中使用什么来优化性能?我看到他们的很多方法都涉及 URL,但我是从 Parse 填充的,所以它似乎无关紧要。我也试过缩小我的图像,这在一定程度上有所帮助,但我仍然遇到内存问题。这是我之前的问题:iOS Memory Warnings

最佳答案

我在 Swift 4 上以下列方式在 Parse Server 中实现了它

let pic = object?.object(forKey: "pic") as! PFFile
imageView.sd_setImage(with: URL(string: pic.url!), completed: nil)

希望对你有帮助

关于ios - 将 SDWebImage 与解析一起使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31941181/

相关文章:

ios - CIFilter/CI图像 : BSXPCMessage received error for message: Connection interrupted

ios - 让粒子系统遵循SceneKit中的节点路径

ios - 传递 "partial closure"的优雅方式?

php - 受内存/大小限制反序列化

ios - UIBarButtonItem 在 View 更改之前不会被禁用

ios - Realm 模型类的问题

Swift 3 - 将 map 类型从 View Controller 更改为另一个

ios - AVSpeechSynthesizer错误: An AVSpeechUtterance shall not be enqueued twice

ios - 具有多个覆盖内存问题的 MKMapView

linux - Linux 设备上的内存泄漏