在当前线程中做事情:
performSelector:withObject:afterDelay:
performSelector:withObject:afterDelay:inModes:
取消发送给当前线程的某个消息
cancelPreviousPerformRequestsWithTarget:
cancelPreviousPerformRequestsWithTarget:selector:object:
要点 必须要保证在同一个线程内执行以下方法 否则会导致取消任务失败!!!
延时执行方法
[self performSelector:@selector(scrollDone) withObject:nil afterDelay:0.5];
在0.5秒内取消执行函数,带的参数必须一样,才能取消成功
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(scrollDone) object:nil];