Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'd use the last method you listed (Asynchronous Table Cell Lookup) but only look images for the current records being displayed. I overload the UIScrollViewDelegate methods to find out when a user has stopped scrolling, and then only start making requests for the current visible cells. </p> <p>Something like this (this is slightly modified from a tutorial I found on the web which I can't find now, apologies for not citing the author) :</p> <pre><code>- (void)loadContentForVisibleCells { NSArray *cells = [self.table visibleCells]; [cells retain]; for (int i = 0; i &lt; [cells count]; i++) { // Go through each cell in the array and call its loadContent method if it responds to it. AddressRecordTableCell *addressTableCell = (AddressRecordTableCell *)[[cells objectAtIndex: i] retain]; [addressTableCell loadImage]; [addressTableCell release]; addressTableCell = nil; } [cells release]; } - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; { // Method is called when the decelerating comes to a stop. // Pass visible cells to the cell loading function. If possible change // scrollView to a pointer to your table cell to avoid compiler warnings [self loadContentForVisibleCells]; } - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate; { if (!decelerate) { [self loadContentForVisibleCells]; } } </code></pre> <p>Once you know what address records are currently visible, just doing a search for those (5 -7 records probably) will be lightning fast. Once you grab the image, just cache it in a dictionary so that you don't have to redo the request for the image later.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload