views:

102

answers:

2

I referenced this question: http://stackoverflow.com/questions/993280/how-to-detect-when-a-uiscrollview-has-finished-scrolling

UITablewView is a subclass of UIScrollView, and my UITableView delegate does get the - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView message when I scroll the table by hand.

However, when I call - (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated to scroll the table, I don't get the scrollViewDidEndDecelerating message. I am calling the scrollRowToIndexPath... method with animated:YES.

Is this a bug/API limitation (on iPhone SDK 3.1.3) or am I missing another way to do this?

+1  A: 

-scrollViewDidEndDecelerating: is called when there's scrolling animation; there isn't in your sample. Use -scrollViewDidScroll: instead.

Ben Gottlieb
Sorry, should have been clearer in my question, I am calling scrollToRowAtIndexPath with animated:YES, but still not seeing -scrollViewDidEndDecelerating:. I added a -scrollViewDidScroll: like you suggested, however it's called 15 times, which makes it difficult to tell when scrolling has completed.
ChrisW
A: 

Just in case someone is still chasing this one, the Apple docs say the following under the scrollToRowAtIndexPath:atScrollPosition:animated: documentation:

"Invoking this method does not cause the delegate to receive a scrollViewDidScroll: message, as is normal for programmatically-invoked user interface operations."

oldbeamer