1.执行
[self performSelector:@selector(showNextMessage) withObject:nil afterDelay:1];
2.取消
[NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(showNextMessage) object:nil];
Cancels perform requests previously registered with performSelector:withObject:afterDelay:. | |
| All perform requests are canceled that have the same target as aTarget, argument as anArgument, and selector as aSelector. This method removes perform requests only in the current run loop, not all run loops. |