Q:

disable scrollPosition while scrolling

I have a program that uses scrollPosition= UITableViewScrollPositionTop to display the selected row on top. But when i scroll down and click on any other row, scroller  scrolls back to the first selected row. is there any way i can disable the UIScrollPositionTop while i am scrolling. Or Any other solutions please?
This method is called after regular intervals to highlight (select) the rows.  
-(void)highlightcell:(int *)rows {

NSIndexPath *indexPath = [NSIndexPath indexPathForRow:*rows inSection:0]; 
[tableview selectRowAtIndexPath:indexPath animated:YES  scrollPosition:UITableViewScrollPositionTop];

}

A:

You can use UIScrollView delegate to detect when scroll is started and when it has stopped, then use a flag to keep scrolling states as below:
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView
{
    isScrolling = YES;
}

- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
    isScrolling = NO;
}

Then in your method:
-(void)highlightcell:(int *)rows {
    NSIndexPath *indexPath = [NSIndexPath indexPathForRow:*rows inSection:0]; 

if (isScrolling) {
    [tableview selectRowAtIndexPath:indexPath animated:YES     scrollPosition:UITableViewScrollPositionNone];
}
else {
    [tableview selectRowAtIndexPath:indexPath animated:YES     scrollPosition:UITableViewScrollPositionTop];
}

}

