0

I write a table view/collection view to show lots of photo. I use dispatch queue to load photo from Internet and use NSCache to cache photo (for not loading photo from internet again).

when I loaded over 2000 photo, app received memory warning. I tried to release the content of nscache in didreceiveMemoryWarning(), or set the nscache delegate to let nscache to auto release nscache content.

after releasing the content of nscache and I scrolled to the top of the table view,

  • sometimes: the thumbnail load different images several times (show image1, image5, image 6)
  • sometimes: the thumbnail won't show anything

I guess what caused this happened is --> using dispatch queue to show thumbnails in table view


but I don't know how to fix it!!

anyone knows? or is there any better way to show lots of photos(over 3000)?

thank you!!

prettydog
  • 235
  • 3
  • 12
  • My first thought: Think about using a library for your image handling like SDWebImage. It does exactly what you need and is really easy to use. – Jörn Buitink Dec 15 '15 at 07:08
  • thank you for your replying, I am going to take a look at it!look like very easy!!! – prettydog Dec 15 '15 at 07:32

0 Answers0