【问题标题】:iOS - UIWebView - weird concatenation to urliOS - UIWebView - 奇怪的连接到 url
【发布时间】:2014-04-04 19:00:12
【问题描述】:

我有一个UIWbView,并使用编码的网址加载它:http%3A%2F%2Fwww.google.com%0A

当我调试时,停在:

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

[[request URL] absoluteString] 返回

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

框架加了file://前缀,WHY???我没有要求...:/

【问题讨论】:

  • 你能显示一些代码吗??

标签: ios iphone uiwebview nsurl


【解决方案1】:

它假定它是一个file:// URL,因为它没有在http%3A%2F%2Fwww.google.com%0A 中找到URL scheme

把网址改成http://www.google.com就可以了(后面的%0A也是可疑的)。

【讨论】:

  • 我正在检查,但你能解释一下原因吗?
猜你喜欢
  • 1970-01-01
  • 2013-04-17
  • 2011-01-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-11-26
相关资源
最近更新 更多