Skip to content

Commit

Permalink
修正寫法上的錯誤
Browse files Browse the repository at this point in the history
  • Loading branch information
DaidoujiChen committed Jan 16, 2015
1 parent 1027ebd commit 7a3b05a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion e-Hentai/HentaiDownloadCenter/HentaiDownloadBookOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,17 @@ - (void)downloadResult:(NSString *)urlString heightOfSize:(CGFloat)height isSucc
self.failCount++;
self.maxHentaiCount = [NSString stringWithFormat:@"%ld", [self.maxHentaiCount integerValue] - 1];

NSUInteger removeIndex = NSNotFound;
for (NSString *eachURLString in self.hentaiImageURLs) {
if ([eachURLString isEqualToString:urlString]) {
[self.hentaiImageURLs removeObject:eachURLString];
removeIndex = [self.hentaiImageURLs indexOfObject:eachURLString];
break;
}
}

if (removeIndex != NSNotFound) {
[self.hentaiImageURLs removeObjectAtIndex:removeIndex];
}
}
}
self.status = HentaiDownloadBookOperationStatusDownloading;
Expand Down
8 changes: 7 additions & 1 deletion e-Hentai/PhotoViewController/PhotoViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,17 @@ - (void)downloadResult:(NSString *)urlString heightOfSize:(CGFloat)height isSucc
self.failCount++;
self.maxHentaiCount = [NSString stringWithFormat:@"%ld", [self.maxHentaiCount integerValue] - 1];

NSUInteger removeIndex = NSNotFound;
for (NSString *eachURLString in self.hentaiImageURLs) {
if ([eachURLString isEqualToString:urlString]) {
[self.hentaiImageURLs removeObject:eachURLString];
removeIndex = [self.hentaiImageURLs indexOfObject:eachURLString];
break;
}
}

if (removeIndex != NSNotFound) {
[self.hentaiImageURLs removeObjectAtIndex:removeIndex];
}
}
}
}
Expand Down

0 comments on commit 7a3b05a

Please sign in to comment.