1

Could any one please tell me the best image cache available for loading numerous images in UITableviewcell?

Currently i am using SDWebimageCache but it seems it is creating problems in IOS9 particularly in iPad where the table scrolling makes the app to crash.

Help me with SDWebimagecache alternative.

The class which i used from SDWebImageCache is:

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

The class which i used from UIIMageView + AFNetworking is:

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

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

But still the application crashes and shows the following screen:

APPLICATION CRASHES IN IOS 9 and sometimes for IOS 8.4

Please help me from this situation. Lots of pressure ...

enter image description here

Daniella D'Cruz
  • 388
  • 1
  • 3
  • 15
  • That isn't so much as a crash, rather an Xcode bug / issue where it looses connection to the device as it states. Try running the app in the simulator if you're having device issues. – Robert J. Clegg Nov 16 '15 at 10:02
  • I first thought that .. But i am 100 percent sure that it is not the case.. The app crashes still when i disconnect the cable. – Daniella D'Cruz Nov 16 '15 at 10:04
  • Go into Xcode, and then into the breakpoint navigator (cmd + 7) and add an all exception breakpoint. And run the app again to see where it crashes. Right now; there is not enough information to help with anything. You need to isolate the offending code that causes the issue. – Robert J. Clegg Nov 16 '15 at 10:06
  • [cell.imgMain sd_setImageWithURL:imageLoadUrl placeholderImage:[UIImage imageNamed:@"*placeholder image*"] options:SDWebImageRefreshCached]; – Daniella D'Cruz Nov 16 '15 at 10:09
  • if i comment this it works fine – Daniella D'Cruz Nov 16 '15 at 10:09

3 Answers3

1

AFNetworking has a great UIImage category that does this well and works on iOS9. I too had issues with SDWebimageCache on iOS9.

Robert J. Clegg
  • 7,231
  • 9
  • 47
  • 99
  • Thanks Dude !! Could you please refer me with another image cache category class?? – Daniella D'Cruz Oct 28 '15 at 10:08
  • What's wrong with AFNetworking that doesn't suit your needs? I use AFN in my project for network calls as well as image loading. Have done for the last two years and its a very solid library – Robert J. Clegg Oct 28 '15 at 10:11
  • Okk...Could you please provide me with image cache tutorial using AFnetworking please?? – Daniella D'Cruz Oct 28 '15 at 10:13
  • The problem is not your library you are using; it will be your code. To have two different libraries crashing suggests an issue in your code. Update your question with the relevant code and exact crash log that shows in the console – Robert J. Clegg Nov 16 '15 at 09:37
0

Take a look at 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

Community
  • 1
  • 1
ShahiM
  • 3,179
  • 1
  • 33
  • 58
0

You can use JMImageCache For lazy loading of image in UITableView

Maulik Patel
  • 397
  • 4
  • 15