我曾经可以在AFHTTPClient
类上使用cancelAllHTTPOperationsWithMethod:
来取消操作。现在取消操作的新方法是什么?
我曾经可以在AFHTTPClient
类上使用cancelAllHTTPOperationsWithMethod:
来取消操作。现在取消操作的新方法是什么?
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
还拥有一个operationQueue
属性,如果您更喜欢NSURLSession
。