I have a UIWbView and I load it with an encoded url: http%3A%2F%2Fwww.google.com%0A

When i debug, and stop at:

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType 

the [[request URL] absoluteString] returns

{ URL: file://http%3A%2F%2Fwww.google.com%0A }

The framework added file:// prefix, WHY??? I didn't ask for that... :/

有帮助吗?

解决方案

It assumed it was a file:// URL as it didn't find a URL scheme in http%3A%2F%2Fwww.google.com%0A.

Change the URL to http://www.google.com and it will be fine (that trailing %0A is also suspicious).

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top