【问题标题】:How to stop AFHTTPRequestOperation?如何停止 AFHTTPRequestOperation?
【发布时间】:2012-11-09 08:49:20
【问题描述】:

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

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

【问题讨论】:

  • 您能否编辑您的问题以显示一些代码,显示您当前如何取消请求操作?并且该操作是在与您调用取消的线程不同的线程上进行的,对吗?
  • 也许这会有所帮助 - stackoverflow.com/questions/12361824/…

标签: ios afnetworking nsoperation nsoperationqueue


【解决方案1】:

AFAIK,AFHTTPRequestOperation 只能跟随你!

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-05
    • 1970-01-01
    • 1970-01-01
    • 2015-12-08
    相关资源
    最近更新 更多