【发布时间】:2012-08-06 14:59:23
【问题描述】:
我使用这行代码将本地 html 文件加载到 web 视图中:
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html" inDirectory:@"html"]];
但是我想在 url 中添加一些 http 参数,但到目前为止没有运气。
我试过这个:
url = [url URLByAppendingPathComponent:@"?param1=1"];
但在此之后,网页视图中不会加载 html。
有没有办法在 webview 中使用参数加载本地 html 文件?
【问题讨论】:
-
如果你
NSlog添加参数后的URL是否包含它们?
标签: iphone ios parameters append nsurl