如何停止AFHTTPRequestOperation?

时间:2012-11-09 08:49:21

标签: ios afnetworking nsoperation nsoperationqueue

取消可能会停止AFHTTPRequestOperation的实例,但有时会失败。

任何人都有解决方案立即停止AFHTTPRequestOperation实例或延迟几秒钟?

1 个答案:

答案 0 :(得分:0)

AFAIK,只有您可以使用AFHTTPRequestOperation进行操作!

 AFHTTPRequestOperation *operation = [AFHTTPRequestOperation operationWithRequest:request success:success failure:failure];
 [self.operationQueue addOperation:operation];
 [operation performSelector:@selector(cancel) withObject:nil afterDelay:.5];