下面的代碼是用來顯示pdf或者.doc文件。如果用ofType:@:”pdf”運行正常,但是如果用 ofType:@:”doc” 或者 ofType:@:”docx” 就會崩潰。word文件中大部分都是文本和一些鏈接,不知道應該怎麼解決?
謝謝
NSString *path = [[NSBundle mainBundle] pathForResource:@"C9" ofType:@"doc"];
pdfUrl = [NSURL fileURLWithPath:path];}
[webView loadRequest:[NSURLRequest requestWithURL:pdfUrl]];
試下這個
NSString *path = [[NSBundle mainBundle] pathForResource:@"C9.doc" ofType:nil];
pdfUrl = [NSURL fileURLWithPath:path];}
[webView loadRequest:[NSURLRequest requestWithURL:pdfUrl]];