ios - 在 webView 中加载网站时出现 Swift 错误
问题描述
这是error
我得到的:
获取断言时出错:<Error Domain=RBSAssertionErrorDomain Code=3“目标未运行或缺少所需的目标权利”UserInfo={RBSAssertionAttribute=<RBSDomainAttribute| domain:"com.apple.webkit" name:"Background" sourceEnvironment:"(null)">, NSLocalizedFailureReason=Target 未运行或缺少所需的目标权利}>
我的segmentedController
里面webView
有三个选项:
//MARK: segControlAction
@objc func segControlAction(sender: UISegmentedControl) {
switch sender.selectedSegmentIndex {
case 0: // google
let myURL = URL(string: "https://www.google.com")
let myRequest = URLRequest(url: myURL!)
webView.load(myRequest)
case 1: // amazon
let myURL = URL(string: "https://www.amazon.com")
let myRequest = URLRequest(url: myURL!)
webView.load(myRequest)
case 2: // adidas
let myURL = URL(string: "https://www.adidas.com")
let myRequest = URLRequest(url: myURL!)
webView.load(myRequest)
default:
let myURL = URL(string: "https://www.google.com")
let myRequest = URLRequest(url: myURL!)
webView.load(myRequest)
}
}
谷歌和亚马逊工作得很好,但case 2
(“https://www.adidas.com”)没有加载……我在这里错过了什么?
解决方案
推荐阅读
- java - 创建永久 JUnit 配置的任何方式。在 IntelliJ 上?
- angular - 角度输入值无法更新
- reactjs - 做出反应。为什么我不能从第三方库中插入组件?
- python - 如何在 PyQt5 中添加名为堆栈页面的动态对象?
- python - 有什么方法可以在 python 中生成这样的随机表吗?
- python - Python:从具有类别变量列的一个类别的数据框中创建单独的数据框
- javascript - 如何在react js中使用redux在react js中映射来自api的数组响应?
- sql - 如何在 SQL 中以 0 开头?(例如 1 => 01)
- python - 将 AWS S3 存储桶与 Django 结合使用时出现 TypeError
- ios - 归档时出现“没有这样的模块‘翠鸟’”错误