-1

silly question maybe but, what's the best practice to use the same NSCache image from my initial tableVIew Cell to push it on a static TableView, right now i'm using the same approach on my tableVIew to get the image on my static tableView

1) I have a tableView where I load all the images from a web service, I cache this images on the simulator 2) when I select a cell from the initial tableView,I had the same information from the tableViewCell on a static tableView, my problem is how to use the same image from my initial tableVIewCell from the cache on my static tableView ?

Thanks for your help

Mamoun MK
  • 13
  • 5

3 Answers3

0

Same the images in key value dictionary with index path as key

Safwan Ahmed
  • 205
  • 2
  • 7
0

AFNetworking has a category UIImageView+AFNetworking that will help to reduce code to download image and save it into NSCachedirectory as well as to display in tableview static cell

Anirban iOS
  • 957
  • 7
  • 14
0

I think that SDWebImage is something you can look at.

It provides the downloading of images as well as image caching, it already has the option to use their imageView category:

//found on their github: i.e.
//Storing the image
[[SDImageCache sharedImageCache] storeImage:myImage forKey:myCacheKey];

Then you just have to check if image is there based on the imageKey

Joshua
  • 2,432
  • 1
  • 20
  • 29