Wait until multiple networking requests have all executed - including their completion blocks

后端 未结 4 1137
攒了一身酷
攒了一身酷 2020-11-27 10:33

I have multiple operations (they\'re AFNetworking requests) with completion blocks that takes some time to execute, and a Core Data object that needs to be saved at the end

4条回答
  •  误落风尘
    2020-11-27 11:01

    AFNetworking has designed method for this kind of operations, which abstracts from GCD:

    -enqueueBatchOfHTTPRequestOperationsWithRequests:progressBlock:completionBlock:

    -enqueueBatchOfHTTPRequestOperations:progressBlock:completionBlock:

    Take a look at FAQ

提交回复
热议问题