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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:51:28+00:00 2026-05-17T20:51:28+00:00

I have some large images in a grouped UITableView. There’s 1 row in each

  • 0

I have some large images in a grouped UITableView. There’s 1 row in each section which holds the image and there is associated header and footer text for each section about the image. I worked hard to get it to scroll smoothly is iPhone OS 3.x and finally succeeded. But… when I upgraded to iOS 4, that all changed. Now there is very jerky performance whenever a new cell is loaded. Here is my cellForRowAtIndexPath code:

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

    UIImageView *photo;
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    ApplicationDelegate *appDelegate = (ApplicationDelegate *)[[UIApplication sharedApplication] delegate];

    NSString *fileName = [NSString stringWithFormat:@"%@",[[appDelegate.sectionsDelegateDict objectAtIndex:indexPath.section] objectForKey:@"MainTrackImage"]];
    UIImage *theImage = [UIImage imageNamed:[[appDelegate.sectionsDelegateDict objectAtIndex:indexPath.section] objectForKey:@"MainTrackImage"]];

    imageHeight = CGImageGetHeight(theImage.CGImage);
    imageWidth = CGImageGetWidth(theImage.CGImage);

    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        photo = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, (imageHeight*320)/imageWidth)] autorelease];
        photo.tag = PHOTO_TAG;
        [cell addSubview:photo];
    } else {
        photo = (UIImageView *) [cell viewWithTag:PHOTO_TAG];
        [photo setFrame:CGRectMake(0, 0, 320, (imageHeight*320)/imageWidth)];
    }

    photo.image = theImage;
    return cell;
}

Note: I’ve tried using the following code in place of the “imageNamed” method with no success:

UIImage *theImage = [UIImage imageWithContentsOfFile:[NSString stringWithFormat:@"%@/%@", bundlePath,fileName]];

I’ve even tried pre-caching the images but with no success.
Any help would be greatly appreciated.

UPDATE:
I’ve tried experimenting with using Grand Central Dispatch to load the images by creating an image queue and loading them asynchronously:

dispatch_async(_image_queue, ^{
photoImageView.image = [imageCacheNS objectForKey:imageString];});

The problem I’m getting is that the images load very slowly and when I scroll the table, the previously viewed images are shown for a few seconds until the new image is loaded.

UPDATE 2:
I still have not been able to make this work. I’m now looking into using the drawRect method to draw the cell. I’m hoping this will improve scrolling performance. Apple’s tableViewSuite sample code example #5 shows how to do this, but I’m having trouble finding out how to make this work for my project. Anyone have any experience using drawRect: to loading images into a tableview?

Thanks!

  • 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-17T20:51:29+00:00Added an answer on May 17, 2026 at 8:51 pm

    After a huge amount of work and several communications with Apple dev support, I finally got this working. I am now loading very large images in a tableview in the background and have very fast scrolling performance.

    Basically, I followed parts of the code from WWDC 2010 sample code “CoreAnimationImageBrowser”. It’s designed for the iPad and is based around a custom scrollView instead of a tableView, but the ImageScrollView class is the one to use to load your images.

    Then, the really weird thing I had to do to account for the fact that the cells can’t be preloaded in a tableView was to add the images as subviews BEHIND the tableView. As the table is scrolled, the images are already loaded and are quick to load.

    Sort of a weird hack, but the Apple Tech seemed to think it was fine.

    Good luck to anyone trying to do this. It took quite a bit of time for me to get it figured out.

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

Sidebar

Related Questions

I have a grouped UITableView with some large images. However, scrolling performance is quite
I have some large files (images and video) which I need to store in
I'm looking at building a Rails application which will have some pretty large tables
I have a large set of files, some of which contain special characters in
I am working for some code with bxslider because I have many large images,
I have some pretty large PNG images stored in a database (example 1000x15000 px,
I have to import a large amount of image crops off of many images
I have an UIView with 8 to 10 large images (each loaded into an
I have a large image I would like as my background, but for some
I'm having some trouble getting large background images I have for a site in

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.