我正在使用一个UIWEBView加载像example.com这样的网络工作正常并要求服务器加载新网址,如果服务器提供的IP地址如192.168.1.23那么这个错误发生,否则像example.com这样的URL工作完美,我不# 39;了解问题
ATS已被禁用,而ip和url正在使用HTTPS
单击按钮并刷新时的此函数调用
- (void)getHTMLData {
reachability = [Reachability reachabilityForInternetConnection];
[reachability startNotifier];
NetworkStatus remoteHostStatus = [reachability currentReachabilityStatus];
if(remoteHostStatus == NotReachable)
{
UIAlertView* alertView;
alertView = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"No Network Reachability " delegate:self
cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
}
else
{
NSString *phyIdTemp=[[NSUserDefaults standardUserDefaults] objectForKey:@"phyId"];
NSString *pathUrl = [[NSUserDefaults standardUserDefaults] objectForKey:@"URL"];
NSURL* nsUrl = [NSURL URLWithString:[NSString stringWithFormat:getDetails, pathUrl]];
[self.webView loadRequest:[NSURLRequest requestWithURL:nsUrl]];
NSLog(@"URLWEBVIEW %@",nsUrl);
}
先谢谢..