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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:08:25+00:00 2026-06-16T23:08:25+00:00

It seems that after a little use my app becomes slow and unresponsive on

  • 0

It seems that after a little use my app becomes slow and unresponsive on the UITableViewController. There are some pretty intensive methods but once these are done there’s no reason why they should effect the overall performance of the app.

I’ve been using instruments to determine what it could be, but it’s proving very inconclusive. First off I can’t recreate the issue via one method, it just seems to occur from general usage. The main thing using CPU is my cellForRowAtIndexPath according to thread usage. While I do actually do quite a lot of calculations, it doesn’t explain two things. 1) Why this issue develops over time. I can scroll up and down the TableViewController several times when I first boot up the app and everything is super smooth. 2) Even when I remove all but 3 or 4 cells the unresponsiveness remains.

Another observation is that a modal ViewController has a very smooth animation when the app is first loaded, but ends up having this horrible jagged animation, sometimes only 1 or 2 frames, later on. Again, there are a couple of fairly complex calculations on the dismissal of this Modal (including a managedObjectContext save), and it does close to reveal the UITableView beneath (meaning some cellForRowAtIndexPath) but there is no way these two things alone can bring the animation to virtually 0 fps. All this has lead me to believe that resources are getting used up and are not returning. Now sadly, I don’t know enough about the iOS environment to be sure about the next assumptions, but here goes:

  • Memory. Simply put, it can’t really be this can it? Even though my app is very memory intensive with lots of images I’m pretty sure iOS removes things from the RAM as it begins to run out. On top of that the diagnostics show that I have had 50MB free when experiencing a huge amount of lag in the app.

  • CPU. I thought potentially that something was using up all my CPU like the last time I had performance issues (I had called an infinite loop of a method, whoops) however, the app seems to use CPU only when needed. In other words, it goes back to 0 usage when the app is idle. Just to explain how this is significant; if the CPU, as a resource, was being eaten up by something then it would explain why cellForRowAtIndexPath was struggling over time. However, since it’s not getting eaten up there’s no reason why prolonged usage of the app should cause cellForRowAtIndexPath to use too much of the CPU. Therefore I can’t see how my issue is caused by the CPU being hogged.

Naturally as those are the only two resources I can think of I am completely and utterly stumped. I have no idea why the app should become slow over time. In effect, I can’t see how it can be code as the app works fine when first starting up and I can’t see how it can be the resources when there seems to be plenty left.

Since I’m new to Objective-C/iOS development I suspect that there’s something I’m missing. If you could help me identify it, I’d really appreciate it.

UPDATE: Posting my code of cellForRowAtIndexPath and willDisplayCell:

- (void)configureCell:(UITableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
myEntityForConfigureCell = [self.fetchedResultsController objectAtIndexPath:indexPath];

searchResultForConfigureCell = [searchResults objectForKey:myEntityForConfigureCell.trackId];


// Example of how I fill in cell information. There are far more than shown.
nameLabelForConfigureCell = (UILabel *)[cell viewWithTag:1001];
nameLabelForConfigureCell.text = myEntityForConfigureCell.name;

genreLabelForConfigureCell = (UILabel *)[cell viewWithTag:1002];
genreLabelForConfigureCell.text = searchResultForConfigureCell.genre;

// Example of how I do the ImageViews using AFNetworking
imageForConfigureCell = (UIImageView *)[cell viewWithTag:1000];
[imageForConfigureCell setImageWithURL:[NSURL URLWithString: searchResultForConfigureCell.artworkURL60]];
imageForConfigureCell.layer.cornerRadius = 9.4;
imageForConfigureCell.layer.masksToBounds = YES;

// The RateView for showing a start rating
rateViewForConfigureCell = [[DYRateView alloc] initWithFrame:CGRectMake(73, 44, 75, 12) fullStar:[UIImage imageNamed:@"StarFullSmall.png"] emptyStar:[UIImage imageNamed:@"StarEmptySmall.png"]];
rateViewForConfigureCell.rate = [searchResultForConfigureCell.rating floatValue];
rateViewForConfigureCell.alignment = RateViewAlignmentLeft;
[cell.contentView addSubview:rateViewForConfigureCell];

// Setting Sections for all Core Data entries only if BOOL isLoading is YES, but **has** finished downloading informaton, i.e. just before completion.

if ([searchResults count] == [fetchedResultsController.fetchedObjects count]) {

    if (isLoading) {
        NSLog(@"Is loading so Setting Sections");
        isLoading = NO;
        [self cycleThroughEntriesAndSetSection];
    }
    else if (!isLoading){
        [loadingHudView removeFromSuperview];
    }

}

}

And now for willDisplayCell:

-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
myEntityForDisplayCell = [self.fetchedResultsController objectAtIndexPath:indexPath];
searchResultForDisplayCell = [searchResults objectForKey:myEntityForDisplayCell.trackId];

UILabel *currentPrice = (UILabel *)[cell viewWithTag:1003];

if ([myEntityForDisplayCell.price1 floatValue] == [searchResultForDisplayCell.price2 floatValue]) {
   currentPrice.textColor = [UIColor blackColor];
}
else if ([myEntityForDisplayCell.price1 floatValue] > [searchResultForDisplayCell.price2 floatValue])
{
    currentPrice.textColor = [UIColor colorWithRed:0 green:0.9 blue:0 alpha:1];
}
else if ([myEntityForDisplayCell.price1 floatValue] < [searchResultForDisplayCell.price2 floatValue])
{
    currentPrice.textColor = [UIColor redColor];
}

cell.backgroundColor = nil;

if (isLoading) {
    loadingHudView.numOne = [searchResults count];
    loadingHudView.numTwo = [fetchedResultsController.fetchedObjects count];
    [loadingHudView setNeedsDisplay];
}

if ([searchResults count] == [fetchedResultsController.fetchedObjects count]) {

    [loadingHudView removeFromSuperview];

    if ([myEntityForDisplayCell.price1 floatValue] < [searchResultForDisplayCell.price2 floatValue]) {

        cell.backgroundColor = nil;
    }
    else
    {
        cell.backgroundColor = [UIColor colorWithRed:1 green:0.85 blue:0 alpha:0.45];
    }
}

}

UPDATE 2: Found something with the Analyser tool. I’m not entirely sure how it’s a leak, but here goes anyway.

SearchResult *searchResult = [[SearchResult alloc] init];

for (id i in fetchedResultsController.fetchedObjects) {
    MyEntity *myEntity = i;
    searchResult = [searchResults objectForKey:myEntity.id];

This bit of code will probably be executed once per everytime a new entity is added to the Core Data database, i.e. not particularly often.

  • 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-16T23:08:27+00:00Added an answer on June 16, 2026 at 11:08 pm

    Three observations:

    1. You say “lots of images I’m pretty sure iOS removes things from the RAM as it begins to run out” — FYI, if you’re using imageNamed, it’s not very good about managing your memory. When I’m doing image caching, I use my own NSCache. This is especially important if you’re using large images.

    2. See WWDC 2012 – Building Concurrent User Interfaces on iOS for practical example of how to use Instruments to identify where your performance bottlenecks are.

    3. Finally, see Finding leaks with Instruments for guidance on how to use Instruments to find leaks. Also, don’t overlook the static analyzer, which is important if you don’t use ARC, or if you use any Core Foundation calls.

    Other than that, it’s hard to identify sources of your problems without seeing code.


    Update:

    Now that you’ve provided a little source code, the one thing that leaps out at me is the addSubview of rateViewForConfigureCell. Given that cells are reused, you’ll be adding that repeatedly to cells. So, I’d suggest replacing:

    // The RateView for showing a start rating
    rateViewForConfigureCell = [[DYRateView alloc] initWithFrame:CGRectMake(73, 44, 75, 12) fullStar:[UIImage imageNamed:@"StarFullSmall.png"] emptyStar:[UIImage imageNamed:@"StarEmptySmall.png"]];
    rateViewForConfigureCell.rate = [searchResultForConfigureCell.rating floatValue];
    rateViewForConfigureCell.alignment = RateViewAlignmentLeft;
    [cell.contentView addSubview:rateViewForConfigureCell];
    

    With:

    // The RateView for showing a start rating
    rateViewForConfigureCell = (DYRateView *)[cell.contentView viewWithTag:1005]
    if (!rateViewForConfigureCell) {
        rateViewForConfigureCell = [[DYRateView alloc] initWithFrame:CGRectMake(73, 44, 75, 12) fullStar:[UIImage imageNamed:@"StarFullSmall.png"] emptyStar:[UIImage imageNamed:@"StarEmptySmall.png"]];
        rateViewForConfigureCell.alignment = RateViewAlignmentLeft;
        rateViewForConfigureCell.tag = 1005;
        [cell.contentView addSubview:rateViewForConfigureCell];
    }
    rateViewForConfigureCell.rate = [searchResultForConfigureCell.rating floatValue];
    

    Either do that, or add the DYRateView to your cell prototype.

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

Sidebar

Related Questions

I've noticed that my entire app becomes very unresponsive after a little use. I
After looking at RescueTime for windows/mac, it seems that there's a version for linux
It appears after much searching that there seems to be a common problem when
Seems that even after unchecking the option in the PyDev/Debug preferenecs pane to launch
It seems that runClasses() doesn't terminate the code being tested even after the test
After much reading it seems that, really, the only way to read a number
it seems that my code adds 6 bytes to the result file after encrypt
I'm writing an identi.ca client, and seems that @reply isn't working. After investigation I
I have a capistrano deployment that seems to be working fine, however after the
It seems that we can show layers and even use a different zPosition for

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.