【问题标题】:Swift Error : Classes implemented in two places but files I don't touch?Swift 错误:在两个地方实现的类但我不接触的文件?
【发布时间】:2017-10-06 08:56:05
【问题描述】:

我正在测试 swifts UIWebView,我在故事板上放置了一个简单的 UIWebview,这是我的 viewController 代码

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var webView: UIWebView!

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        let url = URL(string: "https://mywebsitehere.com")
        webView.loadRequest(URLRequest(url: url!))

    } }

不幸的是,我在下面收到此错误,我已将应用程序传输安全设置添加到我的应用程序中,就像对类似问题的其他答案所说的那样,但它仍然无法正常工作......

有人可以帮忙吗?

objc[946]:PLBuildVersion 类在两者中都实现 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x124feecc0) 和 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x124e056f0)。将使用两者之一。哪一个是未定义的。

【问题讨论】:

标签: ios swift uiwebview


【解决方案1】:

这是 xCode 在模拟真实 iOS 设备时出现的错误,有时会出现此类错误。 请检查您的网址是否有效。

let url = URL(string: "https://google.com")
webView.loadRequest(URLRequest(url: url!)) 

我在 google URL 中使用了相同的代码,它正在工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-08-17
    • 1970-01-01
    • 2017-07-16
    • 2020-02-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多