1. 程式人生 > >ios webView在載入html的時候,怎麼傳引數?

ios webView在載入html的時候,怎麼傳引數?

解決 辦法
將引數拼接到url上 用

NSURL *url = [NSURL URLWithString:[[NSString stringWithFormat:@“拼接引數“] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] relativeToURL:[NSURL URLWithString:path]];//path是路徑
[self.webView loadRequest:[NSURLRequest requestWithURL:url cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.f]];