AFNetWork中断单个多个全部请求的方法

取消单个请求操作:
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];

你可能感兴趣的:(ios开发)