【发布时间】:2017-06-29 19:05:28
【问题描述】:
我正在创建带有链接 https://www.wella.com 的 NSURLConnection,该链接最终传递给 UIWebView
NSURL *url = [NSURL URLWithString:[[u stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
self.authRequest = [NSURLRequest requestWithURL:url cachePolicy:NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval:30];
self.authConnection = [NSURLConnection connectionWithRequest:authRequest delegate:self];
我意外地收到了身份验证质询,当然我目前还没有处理。 我注意到在使用桌面浏览器时,当我粘贴上面的链接时,它的地址会自动更改为https://www.wella.com/professional/countryselector
粘贴扩展链接时,NSURLConnection 可以正常工作。
我怎样才能摆脱这个挑战,它是否与链接自动更改有某种联系?
编辑:我已经解决了。然而,问题仍然存在:为什么自动链接更改会导致调用身份验证质询?
【问题讨论】:
标签: ios uiwebview nsurlconnection