Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableView Lazy Image Load, images appear after table STOPS scrolling

I implemented lazy image load for my UITableView using NSUrlConnection. This is all working very nicely. When I open my table, I automatically get the images when I wait for a second (on 3G). However, when I scroll, the table loads the new cell's, starts the NSURLConnections, but when the image is finished loading (in code), they do not get put into the view until the table actually stops scrolling..

The Youtube application is able to load the images into the table WHILE scrolling, I'd like to do this as well, any hints / pointers?

like image 420
e75deaf2-fb2a-43e0-91ba-6caad0 Avatar asked Dec 31 '09 10:12

e75deaf2-fb2a-43e0-91ba-6caad0


1 Answers

I just found my answer thanks to the 'Related' feature to the right.. Delayed UIImageView Rendering in UITableView

You have to start NSUrlConnection in a different run-loop, so that you receive data while the table is scrolling.

Thanks for the answers!

like image 170
e75deaf2-fb2a-43e0-91ba-6caad0 Avatar answered Oct 22 '22 23:10

e75deaf2-fb2a-43e0-91ba-6caad0