AFHTTPRequestOperation Cancel Request

前端 未结 2 1792
遥遥无期
遥遥无期 2021-01-19 17:03

Is there a way to cancel a AFHTTPRequestOperation? I am using it to download a PLIST for example. So I was planning to have a button to cancel the download or task. Is there

相关标签:
2条回答
  • 2021-01-19 17:26

    You can use:

    [operation cancel];
    

    This is an NSOperation method that's implemented by AFNetworking.

    0 讨论(0)
  • 2021-01-19 17:30

    You could use this to cancel all operations:

    [[httpClient operationQueue] cancelAllOperations];
    
    0 讨论(0)
提交回复
热议问题