سؤال

I have a table view that is scrolling slowly. The data is from a server and is save to a NSArray. I've read that the slow scrolling is most likely because the images are loaded within the tableView:cellForRowAtIndexPath: code.

A solution might be to store the images in an ivar and then use them in the table. If that's the case how would I go about doing that? I haven't been able to find any sample code that does image caching and then uses it in UITable...

هل كانت مفيدة؟

المحلول

Have a look on LazyTableImages

This sample demonstrates a multi-stage approach to loading and displaying a UITableView. It begins by loading the relevant text from an RSS feed so the table can load as quickly as possible, and then downloads the images for each row asynchronously so the UI is more responsive.

Build Requirements: iOS SDK 5.0 or later

Runtime Requirements:
iOS 5.0 or later

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top