简体   繁体   English

Swift预期为','分隔符错误

[英]Swift expected ',' separator error

Hi sorry I'm new to xcode and swift and I am having trouble with my UIWebView code 嗨,抱歉,我是Xcode和Swift的新手,我的UIWebView代码遇到了问题

I'm getting an expected ',' separator error in my code 我的代码中出现预期的','分隔符错误

@IBOutlet var WebView: UIView!

override func viewDidLoad() {
    super.viewDidLoad()
    let url = NSURL(string: "http://heartburncenterofcalifornia.com/testimonials/")
    let request = NSURLRequest(URL: url!)
    UIWebView.loadRequest(_ request: NSURLRequest)
}

PLEASE I DON'T KNOW HOW TO FIX IT 请我不知道如何解决它

the error is on the UIWebView.loadRequest(_ request: NSURLRequest) line 错误在UIWebView.loadRequest(_ request:NSURLRequest)行上

UPDATE: I did that and now it's coming up with a thread 1: signal SIGABRT error 更新:我做到了,现在它有了一个线程1:信号SIGABRT错误

class AppDelegate: UIResponder, UIApplicationDelegate { 类AppDelegate:UIResponder,UIApplicationDelegate {

on that^ line of my app delegate swift file when I try to run the simulator 当我尝试运行模拟器时,在我的应用程序委托swift文件的那一行上

Your WebView is subclass of UIView rather than UIWebView . 您的WebViewUIView子类,而不是UIWebView Fix this issue and then send load request: 解决此问题,然后发送加载请求:

@IBOutlet var WebView: UIWebView!
    override func viewDidLoad() {
        super.viewDidLoad()
        let url = NSURL(string: "http://heartburncenterofcalifornia.com/testimonials/")
        let request = NSURLRequest(URL: url!)
        WebView.loadRequest(request)
    }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM