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 9080291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T20:02:58+00:00 2026-06-16T20:02:58+00:00

In my iPhone application I have a tableview with custom imageview and loading images

  • 0

In my iPhone application I have a tableview with custom imageview and loading images from remote location using AsyncImageView class. It works nicely, but one issue is, if I scroll the table, cells will be dequeued and it again trying to get the images from server. So, the method for loading image from AsyncImageView class is calling again and again hence increases the memory allocation, and eventually the app crashes.

Here is my code:

- (UITableViewCell *) getCellContentView:(NSString *)cellIdentifier {

    CGRect CellFrame = CGRectMake(0, 0, 300, 40);

    CGRect userImageFrame = CGRectMake(5, 7, 36, 36);

    UIImageView *userImage;

    UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
    [cell setFrame:CellFrame];

    userImage = [[UIImageView alloc]init];
    userImage.frame = userImageFrame;
    userImage.tag = 3;
    [cell.contentView addSubview:userImage];
    [userImage release];

    return cell;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if(cell == nil)
        cell = [self getCellContentView:CellIdentifier];
    else
        [[AsyncImageLoader sharedLoader] cancelLoadingImagesForTarget:cell.imageView];

    UIImageView *userImage = (UIImageView *)[cell viewWithTag:3];

    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    cell.selectionStyle = UITableViewCellSelectionStyleGray;
    NSString *url = [[NSString alloc]initWithFormat:@"%@%@", CommonImageURL,[AllUsersProfileImageArray objectAtIndex:indexPath.row]];
    NSURL *imageUrl =  [NSURL URLWithString:[url stringByAppendingFormat:@"?%i", rand()]];
    [url release];

    userImage.image = [UIImage imageNamed:@"defaultPerson.png"];
    userImage.imageURL = imageUrl;
    return cell;
}

Is there any possible way to fix the issue? Please help.

  • 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-16T20:02:59+00:00Added an answer on June 16, 2026 at 8:02 pm

    The best solution will be caching the image that is already downloaded and displaying it from there.

    You need to write code for that, or there are some libraries which provide such feature:

    1. HJCache
    2. SDWebImage
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem with loading images from the Documents folder of iPhone application into
I have a custom UIButton class in my IPhone navigation application. When the user
I have an iphone application in which I'm loading a UITableView from 3 types
I'm developing an iPhone application where I have a bunch of images bundled with
I have an iPhone application where i download information from the internet and put
I have an Iphone application in which i am recieving push notifications from the
I have implemented Add to Favourites functionality for my iPhone application. It works fine
I have been developing one application in iPhone and I'm making custom cells for
I have an application (Xcode 4.5) which downloads images from Flicker. I have a
I am trying to customise a TableView in my iPhone application. I have found

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.