- (void)todoSomething:(id)sender
{
//在这里做按钮的想做的事情。
}
- (void)starButtonClicked:(id)sender
{
//先将未到时间执行前的任务取消。
[[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(todoSomething:)object:sender];
[self performSelector:@selector(todoSomething:) withObject:sender afterDelay:0.2f];
}
时间: 2024-11-08 05:16:35