Merge pull request #220 from kirsplatrick/master
Made the batch operation completion block and progress block return on the main thread by default.
This commit is contained in:
commit
9dec7d71e4
1 changed files with 6 additions and 2 deletions
|
|
@ -442,7 +442,9 @@ static void AFReachabilityCallback(SCNetworkReachabilityRef __unused target, SCN
|
|||
{
|
||||
NSBlockOperation *batchedOperation = [NSBlockOperation blockOperationWithBlock:^{
|
||||
if (completionBlock) {
|
||||
completionBlock(operations);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
completionBlock(operations);
|
||||
});
|
||||
}
|
||||
}];
|
||||
|
||||
|
|
@ -454,7 +456,9 @@ static void AFReachabilityCallback(SCNetworkReachabilityRef __unused target, SCN
|
|||
AFCompletionBlock originalCompletionBlock = [[operation.completionBlock copy] autorelease];
|
||||
operation.completionBlock = ^{
|
||||
if (progressBlock) {
|
||||
progressBlock([[batchedOperation.dependencies filteredArrayUsingPredicate:finishedOperationPredicate] count], [batchedOperation.dependencies count]);
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
progressBlock([[batchedOperation.dependencies filteredArrayUsingPredicate:finishedOperationPredicate] count], [batchedOperation.dependencies count]);
|
||||
});
|
||||
}
|
||||
|
||||
if (originalCompletionBlock) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue