Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8420945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:00:12+00:00 2026-06-10T03:00:12+00:00

I encountered a problem of webview and I thin many people had met that.

  • 0

I encountered a problem of webview and I thin many people had met that.

In my app, I have an UITableview and each cell of the tableview is self-defined. In each cell a UIWebview is embedded. I need to display each cell’s content when I scroll my tableview. (webview’s loadsHTML and image_url is from an local array)

Problem is that the UIWebview in each cell loads a remote image url and when user scrolls so fast the table, the webview in the cell can not reac fast enough so the webview may display the repeated image for less than 1 second. (Since I use reusable cell and webview loads from image_url array, so that

image_url = [array_image_url objectAtIndex:[index row]];

For user experience, that is terrible to see the repeated images. I tries to figue it out but still can’t. Can anyone help me on this issue?

PS: If possible, I don’t want to cache image on disk

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T03:00:14+00:00Added an answer on June 10, 2026 at 3:00 am

    I have had a similar problem (I was displaying remote images) and used the UIScrollView delegate methods (UITableView inherits from UIScrollView) to handle when to update my images or not. You can do something similar to load content when the scrolling is stopped:

    // UIScrollView Delegate Methods
    - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
        if (!decelerate) {
            [self loadImagesForOnscreenRows];
        }
    }
    
    - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
        [self loadImagesForOnscreenRows];
    }
    

    EDIT – Forgot the method that actually loads the rows. This might help 🙂
    Note – Some of this code is specific to my app, you will need to adapt to suit your data and web location of the image. Also – the setImageWithURL method is part of the AFNetworking library. If you haven’t checked out AFNetworking, it rocks. If you aren’t already using AFN and don’t need to, then I also added a class I wrote that uses blocks to async load web images.

    - (void)loadImagesForOnscreenRows
    {
        if ([self.phonebookData count] > 0)
        {
            NSArray *visiblePaths = [self.myTableView indexPathsForVisibleRows];
            for (NSIndexPath *indexPath in visiblePaths)
            {
                NSDictionary *selRow = [[self.persons valueForKey:[[[self.persons allKeys] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)] objectAtIndex:indexPath.section]] objectAtIndex:indexPath.row];
    
                PBCell *cell = (PBCell *)[self.myTableView cellForRowAtIndexPath:indexPath];
    
                if ([[selRow objectForKey:@"picFileName"] length] > 0) {           
                    [cell.thumbnailImage setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"YourURLHere/%@",[selRow objectForKey:@"picFileName"]]] placeholderImage:[UIImage imageNamed:@"placeholder.png"]];
    
                } else {
                    cell.thumbnailImage.image = [UIImage imageNamed:@"defaultImage.png"];
                }
            }
        }
    }
    

    Alternative method instead of AFNetworking:

    WebImageOperations.h:
    
    //
    //  WebImageOperations.h
    //
    //  Created by Larry Wilson on 11/11/11.
    //  Copyright (c) 2011 Larry Wilson. All rights reserved.
    //
    
    #import <Foundation/Foundation.h>
    
    @interface WebImageOperations : NSObject {
    }
    
    + (void)processImageDataWithURLString:(NSString *)urlString andBlock:(void (^)(NSData *imageData))processImage;
    
    @end
    

    WebImageOperations.m:

    //
    //  WebImageOperations.m
    //
    //  Created by Larry Wilson on 11/11/11.
    //  Copyright (c) 2011 Larry Wilson. All rights reserved.
    //
    
    #import "WebImageOperations.h"
    #import <QuartzCore/QuartzCore.h>
    
    @implementation WebImageOperations
    
    + (void)processImageDataWithURLString:(NSString *)urlString andBlock:(void (^)(NSData *imageData))processImage
    {
        NSURL *url = [NSURL URLWithString:urlString];
    
        dispatch_queue_t callerQueue = dispatch_get_current_queue();
        dispatch_queue_t downloadQueue = dispatch_queue_create("com.myappname.processimagedataqueue", NULL);
        dispatch_async(downloadQueue, ^{
            NSData * imageData = [NSData dataWithContentsOfURL:url];
    
            dispatch_async(callerQueue, ^{
                processImage(imageData);
            });
        });
        dispatch_release(downloadQueue);
    }
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have encountered a problem. When I use jQuery to load a page that
I recently encountered this problem. I found many instances of people asking the question—
I'v encountered a problem with Google Maps on Android. In my app I have
I encountered a problem. I noticed that a Property (say MyProp ) in my
I've recently encountered a problem designing a web page. I needed to have rounded
I have encountered a problem with creating a thumbnail from an uploaded image file,
Am coding in PyGtk, Gtk3 with WebKit.WebView and have encountered something weird. On unmaximizing
I have a UIWebView that loads a YouTube video. The problem is, that if
I recently updated from mathematica 7.0 to 8.0, and have now encountered problem with
I have encountered a problem in a C program running on an AVR microcontroller

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.