내 앱은 UIWebView에 제약 조건을 추가하기 전에 잘 작동합니다. 그러나 오류가 있습니다.
DiskImageCache: Could not resolve the absolute path of the old directory.
앱은 여전히 작동하며 pdf 파일을 표시합니다. 일부 제약 조건을 추가 한 후에는 pdf 파일이 표시되지 않고 (공백으로 표시됨) 오류 코드가 여전히 존재합니다.
다음은 몇 가지 사진입니다.
그림 1 :
그림 2 :
이것은 내 코드입니다.
{
NSString* tutorialView = [NSString stringWithFormat:@"Chapter %i",tutorialNumber];
NSURL *pathToView = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:tutorialView ofType:@"pdf"]];
[_webView2 loadRequest:[NSURLRequest requestWithURL:pathToView]];
}
PDF 파일을 보는 더 좋은 방법이 있습니까? 저는 iOS 프로그래밍이 처음입니다. 멍청한 질문으로 미안해
다음을 시도하십시오. 나와 함께 완벽하게 작동합니다. :)
UIWebView *pdf = [[UIWebView alloc] initWithFrame:CGM(0,0, self.view.frame.size.width, self.view.frame.size.height)];
NSString *path = [[NSBundle mainBundle] pathForResource:@"Name Of PDF FIle" ofType:@"pdf"];
NSURL *targetURL = [NSURL fileURLWithPath:path];
pdf.scalesPageToFit = YES;
NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];<br>
[pdf loadRequest:request];
[self.view addSubview:pdf];
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다