所以我有一个批处理请求,它是以下代码:
[[AHClient sharedClient] enqueueBatchOfHTTPRequestOperationsWithRequests:requestArray progressBlock:^(NSUInteger numberOfCompletedOperations, NSUInteger totalNumberOfOperations) {
} completionBlock:^(NSArray * operations){
dispatch_async(dispatch_get_main_queue(), ^(void){
//update the UI
});
}];
我尝试通过将 url 的路径保存在数组中来取消请求并执行以下操作:
for (NSString * urlPath in self.currentRequestArray_){
[[AHClient sharedClient] cancelAllHTTPOperationsWithMethod:@"GET" path:urlPath];
}
但似乎它仍然进入完成的块,即:更新 UI。想法或建议?