Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix for processing already processed reviews if more than 20 new revi…

…ews exist
  • Loading branch information...
commit d3763312dc79cd0a7054b8a6d03102f0d0401833 1 parent 955c349
@jonkean authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 Classes/ReviewDownloadManager.m
View
10 Classes/ReviewDownloadManager.m
@@ -136,15 +136,21 @@ - (id)initWithProduct:(Product *)app storeFront:(NSString *)storeFrontID country
productObjectID = [[app objectID] copy];
psc = [[[app managedObjectContext] persistentStoreCoordinator] retain];
storeFront = [storeFrontID retain];
- data = [NSMutableData new];
page = 1;
+ backgroundTaskID = UIBackgroundTaskInvalid;
}
return self;
}
- (void)start
{
- backgroundTaskID = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:nil];
+ NSAssert(canceled == false, nil, nil);
+ // method may be called by connectionDidFinishLoading, and don't want to clobber the existing taskID
+ if (backgroundTaskID == UIBackgroundTaskInvalid) {
+ backgroundTaskID = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:nil];
+ }
+ [data release]; // release fields from potential previous page downloads
+ data = [NSMutableData new];
NSString *productID = _product.productID;
NSString *URLString = [NSString stringWithFormat:@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/customerReviews?s=%@&id=%@&displayable-kind=11&page=%i&sort=4", storeFront, productID, page];
Please sign in to comment.
Something went wrong with that request. Please try again.