//某行已经被选中时调用
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(@"非编辑状态下的选中");
[tableView deselectRowAtIndexPath:indexPath animated:YES];
DownLoadingTableViewCell * cell = (DownLoadingTableViewCell *) [downLoadingTableView cellForRowAtIndexPath:indexPath];
//先将未到时间执行前的任务取消。
[[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(OnClickStartDownload:) object:cell.downLoadBtn];
[self performSelector:@selector(OnClickStartDownload:)withObject:cell.downLoadBtn afterDelay:0.2f];
}
-(void)OnClickStartDownload:(id)sender
{
//处理cell上按钮事件
}
同样这种处理方式用到button连续快速点击上
- (void) allPuseButtonClick//点击按钮触发事件
{
//先将未到时间执行前的任务取消
[[self class] cancelPreviousPerformRequestsWithTarget:self selector:@selector(allTaskBeginDownload)object:nil];
[self performSelector:@selector(allTaskBeginDownload)withObject:nil afterDelay:0.2f];
}
- (void) allTaskBeginDownload
{
//点击按钮触发事件后做的动作
}