ios - UICollectionView loads async image in different cells due to reload during async image downloading -


when loading uicollectionview cells call method downloads image async.

during download however, collection view reloaded , when async image downloaded set in 2 different cells.

i have tried using nsoperationqueue in dealloc call cancelalloperations:, didn't work.

what best way cancel download , can provide sample code?

thanks.

i think best practice launch requests lazily need images, cache results, , have no expectations state of collection when request completes.

reloading collection not invalidating event request image in cell. scrolling away is, user might scroll back. make request, , in completion block request cache result , reloaditemsatindexpaths: on index path associated request.

my answer here, provides working code.


Comments

Popular posts from this blog

Change the color of an oval at click in Java AWT -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -