【发布时间】:2010-06-21 05:42:33
【问题描述】:
我已经尝试了许多线程中指定的许多方法。我的 WebView 仍然没有加载本地 js 文件。 我尝试过的方式
NSString *tempResourcePath=[[NSBundle mainBundle] resourcePath];
NSURL *resourceUrl = [NSURL fileURLWithPath:tempResourcePath];
[webView loadHTMLString:html baseURL:resourceUrl];
NSString *html = [[NSString alloc] initWithContentsOfFile:htmlPath];
NSString *resourcePath = [[NSBundle mainBundle] resourcePath];
//resourcePath = [resourcePath stringByReplacingOccurrencesOfString:@"/" withString:@"//"];
resourcePath = [resourcePath stringByReplacingOccurrencesOfString:@" " withString:@"%20"];
resourcePath = [NSString stringWithFormat:@"file:/%@/",resourcePath];
NSURL *resourceUrl = [NSURL fileURLWithPath: resourcePath];
但网络视图不起作用。谁能帮我解决这个问题?
【问题讨论】: