tatableview與輪播圖滾動衝突問題解決方案async
1、將NSTimer加入到主runloop中並設置runloop 的mode爲NSRunLoopCommonModes或UITrackingRunLoopModeoop
① [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];spa
②線程
[[NSRunLoop mainRunLoop] addTimer:timer forMode:UITrackingRunLoopMode];get
2、將NSTimer加入到子線程中,並開啓子線程runloopit
dispatch_async(dispatch_get_global_queue(0, 0), ^{table
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:self.autoScrollTimeInterval target:self selector:@selector(automaticScroll) userInfo:nil repeats:YES];輪播圖
_timer = timer;select
[[NSRunLoop currentRunLoop] run];queue
});