当我们集成下面的代码时,运行会崩溃,原因没有添加至Bundle 资源库里,需到Build Phases的Copy Bundle Resources里添加本地文件
NSString * ducumentLocation = [[NSBundle mainBundle]pathForResource:@"用户协议文档" ofType:@"docx"];
NSURL*url = [NSURLfileURLWithPath:ducumentLocation];
self.webView.multipleTouchEnabled = YES;
self.webView.scalesPageToFit = YES;
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[self.webViewloadRequest:request];