Tuesday, August 6, 2013

How to improve the iOS table view image loading performance – Method 1


Today I’m going to show you an easy way to improve the performance of table view with images. Normally, when you get images from the Internet and show it get stuck when scrolling. 

We can use dispatch_async to overcome this problem. Then the ios GDC (Grand Central Dispatch) will look after that. The ios will assign the image loading to a background thread while your table will load in the main thread.



Here I’m assigning the background thread to get the UIImage from my method GetImageById, by sending the member id. But to display the image in the table view we have to send that image to the main thread. That is why I’m assigning the loaded image in the dispatch_get_main_queue()block.

No comments:

Post a Comment