|
@@ -377,21 +377,21 @@ |
|
@@ -377,21 +377,21 @@ |
377
|
|
377
|
|
378
|
[operation setCompletionBlock:^(void)
|
378
|
[operation setCompletionBlock:^(void)
|
379
|
{
|
379
|
{
|
380
|
- dispatch_sync(dispatch_get_main_queue(), ^(void)
|
380
|
+ if ( ! [internalOperation isCancelled])
|
381
|
{
|
381
|
{
|
382
|
- if ( ! [internalOperation isCancelled])
|
|
|
383
|
- {
|
|
|
384
|
- progTile++;
|
382
|
+ progTile++;
|
385
|
|
383
|
|
386
|
- if ([_backgroundCacheDelegate respondsToSelector:@selector(tileCache:didBackgroundCacheTile:withIndex:ofTotalTileCount:)])
|
|
|
387
|
- {
|
|
|
388
|
- [_backgroundCacheDelegate tileCache:weakSelf
|
|
|
389
|
- didBackgroundCacheTile:RMTileMake((uint32_t)x, (uint32_t)y, zoom)
|
|
|
390
|
- withIndex:progTile
|
|
|
391
|
- ofTotalTileCount:totalTiles];
|
|
|
392
|
- }
|
384
|
+ if ([_backgroundCacheDelegate respondsToSelector:@selector(tileCache:didBackgroundCacheTile:withIndex:ofTotalTileCount:)])
|
|
|
385
|
+ {
|
|
|
386
|
+ [_backgroundCacheDelegate tileCache:weakSelf
|
|
|
387
|
+ didBackgroundCacheTile:RMTileMake((uint32_t)x, (uint32_t)y, zoom)
|
|
|
388
|
+ withIndex:progTile
|
|
|
389
|
+ ofTotalTileCount:totalTiles];
|
|
|
390
|
+ }
|
393
|
|
391
|
|
394
|
- if (progTile == totalTiles)
|
392
|
+ if (progTile == totalTiles)
|
|
|
393
|
+ {
|
|
|
394
|
+ dispatch_async(dispatch_get_main_queue(), ^(void)
|
395
|
{
|
395
|
{
|
396
|
[weakSelf markCachingComplete];
|
396
|
[weakSelf markCachingComplete];
|
397
|
|
397
|
|
|
@@ -399,9 +399,9 @@ |
|
@@ -399,9 +399,9 @@ |
399
|
{
|
399
|
{
|
400
|
[_backgroundCacheDelegate tileCacheDidFinishBackgroundCache:weakSelf];
|
400
|
[_backgroundCacheDelegate tileCacheDidFinishBackgroundCache:weakSelf];
|
401
|
}
|
401
|
}
|
402
|
- }
|
402
|
+ });
|
403
|
}
|
403
|
}
|
404
|
- });
|
404
|
+ }
|
405
|
}];
|
405
|
}];
|
406
|
|
406
|
|
407
|
[_backgroundFetchQueue addOperation:operation];
|
407
|
[_backgroundFetchQueue addOperation:operation];
|