Renaming numberOfCompletedOperations variable in progress block to numberOfFinishedOperations

This commit is contained in:
Mattt Thompson 2012-08-22 11:32:59 -07:00
parent 706fbe473d
commit 72a85e1ee6
2 changed files with 7 additions and 7 deletions

View file

@ -362,7 +362,7 @@ extern NSString * AFQueryStringFromParametersWithEncoding(NSDictionary *paramete
@discussion Operations are created by passing the specified `NSURLRequest` objects in `requests`, using `-HTTPRequestOperationWithRequest:success:failure:`, with `nil` for both the `success` and `failure` parameters. @discussion Operations are created by passing the specified `NSURLRequest` objects in `requests`, using `-HTTPRequestOperationWithRequest:success:failure:`, with `nil` for both the `success` and `failure` parameters.
*/ */
- (void)enqueueBatchOfHTTPRequestOperationsWithRequests:(NSArray *)requests - (void)enqueueBatchOfHTTPRequestOperationsWithRequests:(NSArray *)requests
progressBlock:(void (^)(NSUInteger numberOfCompletedOperations, NSUInteger totalNumberOfOperations))progressBlock progressBlock:(void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progressBlock
completionBlock:(void (^)(NSArray *operations))completionBlock; completionBlock:(void (^)(NSArray *operations))completionBlock;
/** /**
@ -373,7 +373,7 @@ extern NSString * AFQueryStringFromParametersWithEncoding(NSDictionary *paramete
@param completionBlock A block object to be executed upon the completion of all of the request operations in the batch. This block has no return value and takes a single argument: the batched request operations. @param completionBlock A block object to be executed upon the completion of all of the request operations in the batch. This block has no return value and takes a single argument: the batched request operations.
*/ */
- (void)enqueueBatchOfHTTPRequestOperations:(NSArray *)operations - (void)enqueueBatchOfHTTPRequestOperations:(NSArray *)operations
progressBlock:(void (^)(NSUInteger numberOfCompletedOperations, NSUInteger totalNumberOfOperations))progressBlock progressBlock:(void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progressBlock
completionBlock:(void (^)(NSArray *operations))completionBlock; completionBlock:(void (^)(NSArray *operations))completionBlock;
///--------------------------- ///---------------------------

View file

@ -559,7 +559,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
} }
- (void)enqueueBatchOfHTTPRequestOperationsWithRequests:(NSArray *)requests - (void)enqueueBatchOfHTTPRequestOperationsWithRequests:(NSArray *)requests
progressBlock:(void (^)(NSUInteger numberOfCompletedOperations, NSUInteger totalNumberOfOperations))progressBlock progressBlock:(void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progressBlock
completionBlock:(void (^)(NSArray *operations))completionBlock completionBlock:(void (^)(NSArray *operations))completionBlock
{ {
NSMutableArray *mutableOperations = [NSMutableArray array]; NSMutableArray *mutableOperations = [NSMutableArray array];
@ -572,7 +572,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
} }
- (void)enqueueBatchOfHTTPRequestOperations:(NSArray *)operations - (void)enqueueBatchOfHTTPRequestOperations:(NSArray *)operations
progressBlock:(void (^)(NSUInteger numberOfCompletedOperations, NSUInteger totalNumberOfOperations))progressBlock progressBlock:(void (^)(NSUInteger numberOfFinishedOperations, NSUInteger totalNumberOfOperations))progressBlock
completionBlock:(void (^)(NSArray *operations))completionBlock completionBlock:(void (^)(NSArray *operations))completionBlock
{ {
__block dispatch_group_t dispatchGroup = dispatch_group_create(); __block dispatch_group_t dispatchGroup = dispatch_group_create();
@ -594,15 +594,15 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
originalCompletionBlock(); originalCompletionBlock();
} }
__block NSUInteger numberOfCompletedOperations = 0; __block NSUInteger numberOfFinishedOperations = 0;
[operations enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { [operations enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
if ([(NSOperation *)obj isFinished]) { if ([(NSOperation *)obj isFinished]) {
numberOfCompletedOperations++; numberOfFinishedOperations++;
} }
}]; }];
if (progressBlock) { if (progressBlock) {
progressBlock(numberOfCompletedOperations, [operations count]); progressBlock(numberOfFinishedOperations, [operations count]);
} }
dispatch_group_leave(dispatchGroup); dispatch_group_leave(dispatchGroup);