把本地html目录添加到xcode

ios 加载本地html及资源文件

html资源显示蓝色文件夹

ios 加载本地html及资源文件

WKWebView加载本地html资源

NSString *filePath = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"www"];
NSURL *pathURL = [NSURL fileURLWithPath:filePath];
[self.webView loadRequest:[NSURLRequest requestWithURL:pathURL]];

如果不按照上面步骤,可能加载不到html资源

相关文章: