0

This is a very strange bug. I will try to explain it as best as I can, but I made a video to show you (see below)

Sometimes when we push to a tableview on our navigation controller, the scrolling act like such:

Video of problem here: http://tinypic.com/r/30nkyol/5

  • Flicking will not work. If you flick the scroll view, it will not continue to move after you flick. As soon as you let go of your finger, the tableview will stop where it is.
  • The tableview does not bounce. Because of this, you can go way above the bounds than you normally can.

It is almost as if somehow decelerationRate is set to extremely high so that the scrollview immediately decollates after it has been touched.

Quitting the app and restarting fixes the issue. Also, we have another tableview on a separate view controller and going to that tablieview has never had the problem.

I am wondering if you have ever seen this problem? Or is this a iOS phenomenon?

Our cellforrowatindexpath:

- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    SPMark* mark = self.datasource[indexPath.section];
    NSString* reuseId = [SPHomeViewController cellIdentifierFromData:mark];
    SPTableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:reuseId];
    if (cell == nil) {
        cell = [SPTableViewCell cellFromMark:mark reuseID:reuseId];
        [cell updateView:NO];
    }
    [cell addDataToCell:mark];

    if (indexPath.section >= self.datasource.count - 2 && !self.isLoadingData && self.pageNumber != -1)
        self.fetchNextPage = YES;

    NSLog(@"SUBVIEWS: %d", self.view.subviews.count);

    return cell;
}
Nithin Michael
  • 2,166
  • 11
  • 32
  • 56
evenodd
  • 2,026
  • 4
  • 26
  • 38
  • Sharing code is necessary. Without it, we can only guess. Show the parts of the code that you think are relevant. If more is needed, someone will ask. – CaptJak Dec 16 '13 at 16:33

1 Answers1

0

Are you handling your images in

- (void)prepareForReuse

on your UITableViewCell

It looks like you have multiple Subviews on you cell, a fair few of which are images so just giving it a reuseIdentifier isn't going to be enough. You could always begin by setting all your images to nil here which will probably make them disappear, then gradually change the way you handle them until it's not haemorrhaging memory.

This is a pretty common problem in TableViews however so take a look here and here for some tips on improving tableView scrolling.

Your main problem is memory so use instruments to see whats hogging it all, generally people end up needing to cache their images or render everything into a singular view so only that needs to be cached and re-drawn.

Community
  • 1
  • 1
Tomskiis
  • 134
  • 5