I used to be able to use cancelAllHTTPOperationsWithMethod:
on the AFHTTPClient
class to cancel operations. What is the new method to cancel operations?
You can cancel operations manually. You can get the operations from the operation queue:
AFHTTPRequestOperationManager *manager = // ...
for (NSOperation *operation in manager.operationQueue.operations) {
// here you can check if this is an operation you want to cancel
[operation cancel];
}
// or just cancel all of them!
[manager.operationQueue cancelAllOperations];
AFURLSessionManager
also have an operationQueue
property if you're more into NSURLSession
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With