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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:37:54+00:00 2026-05-26T06:37:54+00:00

I have a UITableView and I am adding custom view to the cell. It

  • 0

I have a UITableView and I am adding custom view to the cell. It lags really but with just 2 cells. Here’s what it looks like, when scrolling it up and down, i can see it stutters/lags so much (this is on iPhone 4s). I looked at App Store app and the scrolling with very complex tableviewcell is verrryyy smooth. Am I doing something wrong?

Here’s my code:

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


    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
        [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];


        UILabel *labelBarcode = [[UILabel alloc] initWithFrame:CGRectMake(80, 7, 150, 15)];
        [labelBarcode setFont:[UIFont fontWithName:@"Helvetica-Bold" size:16]];
        [labelBarcode setTag:10];

        UILabel *labelLength = [[UILabel alloc] initWithFrame:CGRectMake(80, 22, 150, 15)];
        [labelLength setFont:[UIFont fontWithName:@"Helvetica" size:14]];
        [labelLength setTag:11];

        UILabel *labelThickness = [[UILabel alloc] initWithFrame:CGRectMake(80, 37, 150, 15)];
        [labelThickness setFont:[UIFont fontWithName:@"Helvetica" size:14]];
        [labelThickness setTag:12];

        UILabel *labelDiameter = [[UILabel alloc] initWithFrame:CGRectMake(190, 22, 100, 15)];
        [labelDiameter setFont:[UIFont fontWithName:@"Helvetica" size:14]];
        [labelDiameter setTag:13];

        UILabel *labelCoating = [[UILabel alloc] initWithFrame:CGRectMake(190, 37, 100, 15)];
        [labelCoating setFont:[UIFont fontWithName:@"Helvetica" size:14]];
        [labelCoating setTag:14];

        UIImageView *thumbView = [[UIImageView alloc] initWithFrame:CGRectMake(4, 4, 65, 50)];
        [thumbView setContentMode:UIViewContentModeScaleToFill];
        [thumbView setTag:15];


        [[cell contentView] addSubview:thumbView];
        [[cell contentView] addSubview:labelBarcode];
        [[cell contentView] addSubview:labelLength];
        [[cell contentView] addSubview:labelThickness];
        [[cell contentView] addSubview:labelDiameter];
        [[cell contentView] addSubview:labelCoating];

        [thumbView release];
        [labelBarcode release];
        [labelLength release];
        [labelThickness release];
        [labelDiameter release];
        [labelCoating release];

    }
    UILabel *labelBarcode = (UILabel *)[[cell contentView] viewWithTag:10];
    UILabel *labelLength = (UILabel *)[[cell contentView] viewWithTag:11];
    UILabel *labelThickness = (UILabel *)[[cell contentView] viewWithTag:12];
    UILabel *labelDiameter = (UILabel *)[[cell contentView] viewWithTag:13];
    UILabel *labelCoating = (UILabel *)[[cell contentView] viewWithTag:14];
    UIImageView *thumbView = (UIImageView *)[[cell contentView] viewWithTag:15];

    NSDictionary *pipe = [pipes objectAtIndex:row];


    NSString *stringBarcode = [pipe objectForKey:@"Barcode"];
    NSString *stringLength = [NSString stringWithFormat:@"Length: %@", [pipe objectForKey:@"Length"]];
    NSString *stringThickness = [NSString stringWithFormat:@"Wall: %@",[pipe objectForKey:@"Thickness"]];
    NSString *stringCoating = [NSString stringWithFormat:@"Coating: %@", [pipe objectForKey:@"Coating"]];
    NSString *stringDiameter = [NSString stringWithFormat:@"Diameter: %@",[pipe objectForKey:@"Diameter"]];


    [labelBarcode setText:stringBarcode];
    [labelLength setText:stringLength];
    [labelThickness setText:stringThickness];
    [labelDiameter setText:stringDiameter];
    [labelCoating setText:stringCoating];
    [thumbView setImage:[UIImage imageWithData:[pipe objectForKey:@"Thumbnail"]]];   

    return cell;
}

The lag happens especially when I load the UITableViewController. Note that I am not allocation anything, I only allocate data (from a plist) when the app loads, and the entire app memory consumption is at 1.56 mb.

  • 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-26T06:37:54+00:00Added an answer on May 26, 2026 at 6:37 am

    I’ve had similar problems related to having image views that are doing some type of resizing. I’d check that first. If your thumbView is doing a resize, that by itself can cause the table to lag while scrolling. If that’s the case, you could try prerendering the image resized to the correct size. I’m kinda assuming here that with only two cells you’re not getting any of your cells actually pulled out of the table. The other answers about time to create the image only really apply if you’re doing it multiple times, which would only happen when the cells are reused.

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

Sidebar

Related Questions

I have a UITableView with about 20 cells, in each cell there are three
I have a UITableView with custom cell. I have created seperate class with xib
I have made horizontally scrollable UITableView by adding a table view to a UISrollView
i have uitableview within uitableview (in its cell, like pulse app), and for some
I have UITableView with very large cells with lots of content (more than one
I have a UITableView cell that is going to have a variable size depending
I have a UITableView that displays single large images in each cell. The names
I have a uitableview that loads fairly large images in each cell and the
I have a grouped UITableView with some large images. However, scrolling performance is quite
I am adding user defined text in a UItableView via a modal view controller.

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.