在 IOS 的 UITableView 中加载大量图像的最佳图像缓存?

Best image cache for loading numerous images in UITableView for IOS?

谁能告诉我可用于在 UITableviewcell 中加载大量图像的最佳图像缓存?

目前我正在使用 SDWebimageCache 但它似乎在 IOS9 中产生了问题,特别是在 iPad 中 table 滚动使得应用程序崩溃。

帮助我使用 SDWebimagecache 替代方案。

我从 SDWebImageCache 使用的 class 是:

[cell.imgMain sd_setImageWithURL:imageLoadUrl
                    placeholderImage:[UIImage imageNamed:@"*placeholder image*"]
                             options:SDWebImageRefreshCached];

我从 UIIMageView + AFNetworking 使用的 class 是:

[cell.imgMain setImageWithURLRequest:[NSURLRequest requestWithURL:imageUrl]
                 placeholderImage:[UIImage imageNamed:@"wachizLogoIcon.png"]
                          success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {

                              cell.imgMain.image=image;
                          }
                          failure:nil];

但应用程序仍然崩溃并显示以下屏幕:

应用程序在 IOS 9 中崩溃,有时 IOS 8.4

请帮助我摆脱这种情况。压力很大...

AFNetworking 有一个很棒的 UIImage category,它做得很好并且在 iOS9 上工作。 iOS9 上的 SDWebimageCache 也有问题。

看看AsyncImageView

AsyncImageView includes both a simple category on UIImageView for loading and displaying images asynchronously on iOS so that they do not lock up the UI, and a UIImageView subclass for more advanced features. AsyncImageView works with URLs so it can be used with either local or remote files.

Loaded/downloaded images are cached in memory and are automatically cleaned up in the event of a memory warning. The AsyncImageView operates independently of the UIImage cache, but by default any images located in the root of the application bundle will be stored in the UIImage cache instead, avoiding any duplication of cached images.

The library can also be used to load and cache images independently of a UIImageView as it provides direct access to the underlying loading and caching classes

您可以使用 JMImageCache 在 UITableView 中延迟加载图像