此代码在iOS模拟器中正常运行并显示PDF文件,但是当我在iPhone上运行相同代码时出现此错误“找不到PDF标题:'%PDF'未找到”
NSString *urlAdress= [NSString stringWithFormat: @"http://foodinspections.ocgov.com/foodinspections/inspectionArchives/%@.pdf",
self.inspectionResult.serialNumber];
NSLog(@"url= %@", urlAdress);
NSData *pdfData = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:urlAdress]];
[self.webView loadData:pdfData MIMEType:@"application/pdf" textEncodingName:@"utf-8" baseURL:nil];