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

  • Home
  • SEARCH
  • 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 6949623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:58:46+00:00 2026-05-27T13:58:46+00:00

The below method is causing the Scrolling problem when i run it on my

  • 0

The below method is causing the Scrolling problem when i run it on my iPhone 3S. I know we can increase the performance of Scrolling but don’t know how to do it even after searching a lot on the net and tried several things.

I have come across making cells opaque and/or making Table views as Sub views to greatly increase the Scrolling performance if someone can modify the below code or just point what needs to change in the below code.
My code is below.

// cell is created for each row of track.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{
    NSLog(@"tableView cellForRowAtIndexPath");


    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    [CellIdentifier release];
    cell.accessoryView = nil;

    if (cell == nil)
    {
         cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle 
                                                        reuseIdentifier:CellIdentifier];
    }

     /** saving the data in Book structure.**/
     Book *aBook = [appDelegate.books objectAtIndex:indexPath.row];

     [cell.textLabel setText: aBook.name];

    // indexrow refers to each cell 
    temp =[appDelegate.tracklocation intValue];
    requesttemp =[appDelegate.requestlocation intValue];        

    // Coloring Code starts
    // indexPath starts from 0th cell that is why it is incremented by 1
    if(temp==(indexPath.row+1))
    { 
        NSLog(@"value of temp inside if is = %d",temp);
        NSLog(@"value of indexrow inside if is=%d",(indexPath.row+1));
        UIImageView *imageView1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"speaker.png"]];
        imageView1.backgroundColor = [ UIColor greenColor ];
        cell.contentView.backgroundColor = [ UIColor greenColor ];
        [cell.textLabel setBackgroundColor:[UIColor greenColor]];
        [cell.textLabel setTextColor:[UIColor blackColor]];
        [cell.detailTextLabel setBackgroundColor:[UIColor greenColor] ];
        [cell.detailTextLabel setTextColor:[UIColor blackColor] ];
        cell.accessoryView = imageView1;
        [imageView1 release];
    }
    else 
    {
        cell.contentView.backgroundColor = [ UIColor whiteColor ];
        [cell.textLabel setBackgroundColor:[UIColor whiteColor] ];
        [cell.textLabel setTextColor:[UIColor blackColor ]];
        [cell.detailTextLabel setBackgroundColor:[UIColor whiteColor]];
        [cell.detailTextLabel setTextColor:[UIColor grayColor] ];
    }

        while(requesttemp>temp)
        { 
            if (requesttemp==(indexPath.row+1))
            {
                if (colorflag==1)
                {
                    NSLog(@"value of request temp inside while is = %d",requesttemp);
                    NSLog(@"value of indexrow inside while is=%d",(indexPath.row+1));
                    cell.contentView.backgroundColor = [ UIColor blueColor ];
                    [cell.textLabel setBackgroundColor:[UIColor blueColor ]];
                    [cell.textLabel setTextColor:[UIColor whiteColor ]];
                    [cell.detailTextLabel setBackgroundColor:[UIColor blueColor] ];
                    [cell.detailTextLabel setTextColor:[UIColor whiteColor] ];
                }
            }
            requesttemp=requesttemp-1;
        }
    }    

    cell.detailTextLabel.text = abook.artist;

    cell.detailTextLabel.numberOfLines = 1;

     cell.detailTextLabel.lineBreakMode = UILineBreakModeWordWrap;
     NSLog(@"RootViewController cellForRowAtIndexPath %@ ",cell);

     return cell;
}
  • 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-27T13:58:47+00:00Added an answer on May 27, 2026 at 1:58 pm

    [cellIdentifier release] ??
    You don’t release statics !!
    Your cell reuse is probably failing because of it.

    Also there is no autorelease on UITableViewCell allocation. This should be causing lots of leaks and ultimately slow down / crash the app as well.

    This is a deadly combination of leak + cell reuse failure

    Hope this helps

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

Sidebar

Related Questions

I know the method below isn't meant to work with any Entity, and its
The if statement below has a problem in it somewhere and I can not
I have the below method which is meant to append information to a file
I'm using the below method to reply to mails coming in to a business
I want to fetch a method's comments,take below method for example: /** * Returns
The method below called UserCanAccessThisPage is based on the following logic: each user and
In the method below titleForHeaderInSection , for some reason the NSLog prints out the
See the four lines in the Go() method below: delegate void Action<T>(T arg); delegate
I Send Iqueryable to a function that is below void Method<T>(ref IQueryable<T> qu) {
Below is a method that I want to ship off into a background worker

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.