取消单个请求操作:
AFHTTPRequestOperation *operation
= [[AFHTTPRequestOperation alloc] initWithRequest:request];
[operation cancel];
或者
AFHTTPRequestOperation *operation
= [postManager POST:request.methodUrl
parameters:parameters
success:^(AFHTTPRequestOperation *operation,
id responseObject) {
}failure:^(AFHTTPRequestOperation *operation,
NSError *error){
}];
[operation cancel];
取消所有网络请求:
AFHTTPRequestOperationManager *httpmanager
= [AFHTTPRequestOperationManager manager];
[httpManager.operationQueue cancelAllOperations];
AFNetWork中断单个多个全部请求的方法
最新推荐文章于 2022-11-29 23:58:40 发布