无法使用 http URL 加载我的 Web 视图 [英] Can't load my web view with an http URL

查看:19
本文介绍了无法使用 http URL 加载我的 Web 视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网页视图中加载时出现问题这是我的代码:

I have a problem in loading in my web view This is my code:

NSString *urlString = @"https://www.google.com.eg";

//    NSString *urlString = @"http://fatima.ibtdi.work";

NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
[_fatimaView loadRequest:urlRequest];}

它适用于 Google,但不适用于另一个链接.

It works on Google but doesn't work on the another link.

推荐答案

看起来您需要将一些应用传输安全设置添加到您的信息 plist 试试这个

Looks like you need to add some App Transport Security Settings to your Info plist try this

Web 视图中的任何 HTTP 加载都需要将域添加到这些设置中.

Any HTTP loading in a web view will require adding the domain to these settings.

这篇关于无法使用 http URL 加载我的 Web 视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆