How to avoid slowdowns when scrolling table view?
I have custom table view cell with images (loaded from app document directory), labels, shadows etc. and when I scroll the table view it causes a lot of lags. How can I avoid these lags? I think it's possible to cache table view cell, or get a picture of the table view cell, but I don't know how to implement this. Please, help me :) In cellForRowAtIndexPath: I set the data in P.S. Images in cell are high resolution, but reduced to fit... | |||
add comment |
7 | You should load your images in a background thread. If you're on iOS 4+, you can use GCD (Grand Central Dispatch) to load these asynchronously. | ||
show 1 more comment |
3 | Check This out: http://www.markj.net/iphone-asynchronous-table-image/ This might help. | ||
add comment |
2 | I think you are loading images from URL thats why you are facing lag in scrolling.. you should use Lazy table images check out this -http://developer.apple.com/iphone/library/samplecode/LazyTableImages/index.html have a look into above sample code and post your exp. in comments update 1 - try to remove elements from cell one by one.. and check which element is cause this .. update 2 - ok.. then you know images are causing issues.. so you need to load them using a thread or you can also use lazy table images concept.. seems image size is quite high. | ||||||||||||||||
|
SDWebImage
to help you use a placeholder. Scroll down on this guide here to see an example: highoncoding.com/Articles/… – sudo rm -rf Apr 17 '12 at 14:02