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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:27:57+00:00 2026-05-22T23:27:57+00:00

As i am new in iPad application development please help me in simple problem.

  • 0

As i am new in iPad application development please help me in simple problem.
I want to display images in the tableview from the server. it is displaying correctly.
But when i scroll table upside and come back to again there it will again download image data from server.
Please help me.

EDIT:
tableView:cellForRowAtIndexPath:

static NSString *CellIdentifier = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
[cell setSelectionStyle:UITableViewCellSelectionStyleBlue];
UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 1024, 75)];
[imgView setImage:[UIImage imageNamed:@"strip_normal.png"]];
[imgView setHighlightedImage:[UIImage imageNamed:@"strip_hover.png"]];
[cell addSubview:imgView];
[imgView release];

UIImageView *imgView1 = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, 64, 64)];
imgView1.tag = indexPath.row;
UIImage *img = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.abc.com/abc/%@.png", [[arrMyCourses objectAtIndex:indexPath.row] valueForKey:@"CourseNumber"]]]]];
[imgView1 setImage:img];
[cell addSubview:imgView1];
[imgView1 release];

return cell;

Thanks in advance.

  • 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-05-22T23:27:58+00:00Added an answer on May 22, 2026 at 11:27 pm

    Your problem is this line

    UIImage *img = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.abc.com/abc/%@.png", [[arrMyCourses objectAtIndex:indexPath.row] valueForKey:@"CourseNumber"]]]]];
    

    You are downloading the image every time the table view requests for a cell and believe me this happens quite often as table view doesn’t construct the entire view in a single shot. It reuses the cells going off screen to present new visible cells. So as soon as a cell goes off screen and comes back on, the cellForRowAtIndexPath: is called again. So the image gets downloaded once more. You are also downloading the image synchronously which will block the UI as well.

    To fix this, you should consider downloading them once at the beginning and save them locally in a temporary location and load them into the memory as necessary. Having all of them in the memory can be costly. Additionally, move your download to the background using performSelectorInBackground:withObject. You will have to send the UIKit updates back to the main thread or else you will experience crashes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to objective-c and iOS development. I need an iPad application to display
I’m new to the world of iOS development. I’m creating a iPad application where
We are new to iOS development and this is our first application for iPad
Am new to iPad application. I want to access ipad camera for my application,
I'm pretty new to this. I've compiled an iPad application and I want my
I am new to iPad application development. I have task to develop an application
I am new to ipad development. In my application i have created splitview like
i am new to iPad development. I am making iPad applications. In my application
I have made my application universal for iPhone and iPad (window-based application; universal) from
Hi there Im new to mobile application development. I had developed Android apps using

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.