-(IBAction)_clickautoscroll:(id)sender
{
NSTimer *autoscrollTimer;
if (autoscrollTimer == nil) {
autoscrollTimer = [NSTimer scheduledTimerWithTimeInterval:(55.0/1000.0)
target:self
selector:@selector(autoscrollTimerFired:)
userInfo:nil
repeats:YES];
}
}
- (void)autoscrollTimerFired:(NSTimer*)timer {
CGPoint scrollPoint = self.table.contentOffset;
scrollPoint = CGPointMake(scrollPoint.x, scrollPoint.y + 1);
[self.table setContentOffset:scrollPoint animated:NO];
}
我有这个用于自动滚动 tableviewcell 的代码,当我单击此按钮时,它会自动开始滚动,但我想在另一个按钮单击时停止此操作。如何在单击按钮时停止上述自动滚动。提前感谢。