Made progressBlock call back to the main queue by default.

This commit is contained in:
Patrick Hernandez 2012-02-28 17:12:10 -06:00
parent 0fc6f980b9
commit cc2115e469

View file

@ -456,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) {