runloop
tatableview与轮播图滚动冲突问题解决方案
一、将NSTimer加入到主runloop中并设置runloop 的mode为NSRunLoopCommonModes或UITrackingRunLoopMode
① [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
②
[[NSRunLoop mainRunLoop] addTimer:timer forMode:UITrackingRunLoopMode];
二、将NSTimer加入到子线程中,并开启子线程runloop
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:self.autoScrollTimeInterval target:self selector:@selector(automaticScroll) userInfo:nil repeats:YES];
_timer = timer;
[[NSRunLoop currentRunLoop] run];
});