gpt4 book ai didi

ios - 尝试使用 UIWebView 加载 10 个网页后应用程序崩溃

转载 作者:行者123 更新时间:2023-11-30 12:57:23 25 4
gpt4 key购买 nike

我正在制作一个可以点餐的应用程序。我到达了 paypal 上 UIWebView 页面的结账位置。问题是他们一次加载 9 或 10 个不同的网页。我想知道它们是否是一种使其仅在需要时加载的方法。

import UIKit

class ViewController: UIViewController {
@IBOutlet weak var webView: UIWebView!
@IBOutlet weak var webView1: UIWebView!
@IBOutlet weak var webView2: UIWebView!
@IBOutlet weak var webView3: UIWebView!
@IBOutlet weak var webView4: UIWebView!
@IBOutlet weak var webView5: UIWebView!
@IBOutlet weak var webView6: UIWebView!
@IBOutlet weak var webView7: UIWebView!
@IBOutlet weak var webView8: UIWebView!

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let url = NSURL(string: "https://mms-lunch-order.000webhostapp.com/12count/pay.html")
let request = NSURLRequest(URL: url!)
webView.loadRequest(request)

let url1 = NSURL(string: "https://mms-lunch-order.000webhostapp.com/spicychicken6th/pay2.html")
let request1 = NSURLRequest(URL: url1!)
webView1.loadRequest(request1)

let url2 = NSURL(string: "https://mms-lunch-order.000webhostapp.com/chickensandwhich6th/pay3.html")
let request2 = NSURLRequest(URL: url2!)
webView2.loadRequest(request2)

let url3 = NSURL(string: "https://mms-lunch-order.000webhostapp.com/12count7/pay4.html")
let request3 = NSURLRequest(URL: url3!)
webView3.loadRequest(request3)

let url4 = NSURL(string: "https://mms-lunch-order.000webhostapp.com/spicychicken7/pay9.html")
let request4 = NSURLRequest(URL: url4!)
webView4.loadRequest(request4)

let url5 = NSURL(string: "https://mms-lunch-order.000webhostapp.com/chickensandwhich7/pay7.html")
let request5 = NSURLRequest(URL: url5!)
webView5.loadRequest(request5)

let url6 = NSURL(string: "https://mms-lunch-order.000webhostapp.com/12count8/pay5.html")
let request6 = NSURLRequest(URL: url6!)
webView6.loadRequest(request6)

let url7 = NSURL(string: "https://mms-lunch-order.000webhostapp.com/spicychicken8/pay10.html")
let request7 = NSURLRequest(URL: url7!)
webView7.loadRequest(request7)

let url8 = NSURL(string: "https://mms-lunch-order.000webhostapp.com/chickensandwhich8/pay8.html")
let request8 = NSURLRequest(URL: url8!)
webView8.loadRequest(request8)
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}

最佳答案

这是评论,因为我没有足够的声誉。

我认为可能是@IBOutlet没有正确连接,请您检查一下

关于ios - 尝试使用 UIWebView 加载 10 个网页后应用程序崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40275107/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com