(void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
//当开始拖拽的时候停止定时器
[self.timer invalidate];//停止定时器后,会从消息循环中移除定时 器
self.timer = nil;
}(void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
{
//停止拖拽的时候开启一个新的定时器
self.timer = [NSTimer timerWithTimeInterval:2.0 target:self selector:@selector(nextImage) userInfo:nil repeats:YES];
NSRunLoop *loop = [NSRunLoop currentRunLoop];
[loop addTimer:self.timer forMode:NSRunLoopCommonModes];
}
//定时器那篇设置一个自动翻页的定时器