Próbuję buforować stronę internetową, którą później mogę wyświetlić za pomocą interfejsu UIWebView.NSURLErrorDomain Code -1002 pobieranie pdf
Mam odpowiednie NSURLSessionDataTask
wewnątrz pętli for (próbując buforować 6 stron internetowych) wewnątrz bloku zakończenia innego NSURLSessionDataTask
. Kiedy biegnę, wciąż otrzymuję ten błąd:
Ayy there was error downloading, data:<> response:(null) error:Error Domain=NSURLErrorDomain Code=-1002 "The operation couldn’t be completed. (NSURLErrorDomain error -1002.)" UserInfo=0xdd89d30 {NSUnderlyingError=0xdd89ba0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1002.)"}
Oto urywek co dzwonię
for (MAClass *class in [myDictResult objectForKey:@"classes"]) {
NSString *PRURL = [[[class assignments] objectAtIndex:[[class assignments] count]-1] assignmentName];
NSLog(@"PRURL is %@", PRURL);
NSURLSessionDataTask *progressReportTask = [defaultSession dataTaskWithURL:[NSURL URLWithString:PRURL] completionHandler:^(NSData *progressReportData, NSURLResponse *progressReportResponse, NSError *progressReportError) {
if ([progressReportData length] > 0 && progressReportError == nil) {
NSLog(@"got dat data");
} else NSLog(@"Error with getting data data:%@\nresponse:%@\nerror:%@", progressReportData, progressReportResponse, progressReportError);
}];
[progressReportTask resume];
NSLog(@"After request");
}
Zrobiłem pewien, że adres URL jest poprawny, widząc, że był dla innych osób z tym samym błędem (moje adresy URL są takie jak https://mistar.oakland.k12.mi.us/novi/StudentPortal/Home/PrintProgressReport/20152193^HS4
, które są ważne, gdy umieściłem je w przeglądarce)
Co robię źle?
Coś? GUZ. – AndrewSB