Question

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... :/

Était-ce utile?

La solution

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).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top