2012-11-09 29 views
2

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

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

+0

可以编辑你的问题,显示的代码显示您目前如何取消请求操作一点点?并且该操作在与您要求取消的线程分离的线程上,对吗? –

+0

也许这将有助于 - http://stackoverflow.com/questions/12361824/how-to-immediately-force-cancel-an-nsoperation-with-afnetworking – Anthony

回答

0

AFAIK,没有什么比你能用AFHTTPRequestOperation做的更多!

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