Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,705
6,296
When the app first starts I make sure only one scroll view responds to this, like this:

Code:
tableView.scrollsToTop = YES;
keyboard.scrollsToTop = NO;

And then in the delegate for my tableView I have this:

Code:
- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView
{
    NSLog(@"Asked whether the scroll view should scroll to top.");
    return YES;
}

The NSLog is not being recorded, which means the fact I've touched the status bar isn't making it to the delegate.

I know that my delegate is set up properly because it responds to other delegate methods properly (like whether or not rows should be allowed to be moved.)

Suggestions?
 
Last edited:
When the app first starts I make sure only one scroll view responds to this, like this:

Code:
tableView.scrollsToTop = YES;
keyboard.scrollsToTop = NO;

And then in the delegate for my tableView I have this:

Code:
- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView
{
    NSLog(@"Asked whether the scroll view should scroll to top.");
    return YES;
}

The NSLog is not being recorded, which means the fact I've touched the status bar isn't making it to the delegate.

I know that my delegate is set up properly because it responds to other delegate methods properly (like whether or not rows should be allowed to be moved.)

Suggestions?

Are you ever calling any of these?

– scrollToRowAtIndexPath:atScrollPosition:animated:
– scrollToNearestSelectedRowAtScrollPosition:animated:
-scrollsToTop
– scrollRectToVisible:animated:
 
Are you ever calling any of these?

– scrollToRowAtIndexPath:atScrollPosition:animated:
– scrollToNearestSelectedRowAtScrollPosition:animated:
-scrollsToTop
– scrollRectToVisible:animated:

Yes, why? Does using any of those somehow prevent scroll to top from working?

Edit two weeks later:

I found the issue... I have three scroll views, I was only disabling scrollsToTop for two of them. I'd completely forgotten about the third scroll view because it only becomes visible when the user enters text of sufficient length (like the iMessages app.)
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.