我的UIView中有一个WKWebView,并且网站运行正常,但是我尝试单击文本区域,然后应用程序崩溃并显示这些错误 我正在使用IOS 10和Xcode10
2018-11-08 10:24:36.696196 + 0800 Woofast [14202:3844530] API错误:<_UIKBCompatInputView:0x129d9d210;框架=(0 0; 0 0);层=>返回0宽度,假设UIViewNoIntrinsicMetric
2018-11-08 10:24:36.696349 + 0800 Woofast [14202:3844530] API错误:<_UIKBCompatInputView:0x129d9d210;框架=(0 0; 0 0);层=>返回0宽度,假设UIViewNoIntrinsicMetric
2018-11-08 10:24:36.736874 + 0800 Woofast [14202:3844530]-[UILayoutGuide flk_nameTag]:无法识别的选择器已发送到实例0x281af7640
2018-11-08 10:24:36.740269 + 0800 Woofast [14202:3844530] *由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'-[UILayoutGuide flk_nameTag]:无法识别的选择器已发送至实例0x281af7640 ' * 第一个调用堆栈: (0x1e7647ef8 0x1e6815a40 0x1e755f154 0x1e764d810 0x1e764f4bc 0x106804d68 0x1e7534fdc 0x1e80f4eac 0x1e75f3a4c 0x1e75f51b8 0x1e7fc3e6c 0x213dbcd34 0x213dbcec0 0x1e8033ec4 0x1e802ad94 0x1e802a514 0x1e8029a50 0x1e802979c 0x1e8029020 0x213da70b4 0x213da7534 0x213da7c34 0x213da9990 0x213da9a68 0x1e7fe551c 0x213da9a30 0x213da9f24 0x213db6fec 0x213db5b54 0x213db6004 0x213db5ed8 0x213db5ed8 0x213db5ed8 0x213db5ed8 0x213db5ed8 0x1e7fe551c 0x213db67a8 0x213db513c 0x213db63c8 0x213da63ac 0x213db73e8 0x214564fe0 0x213c87840 0x213d97180 0x213c98250 0x21456ba34 0x213c97f74 0x213c8fc4c 0x213d5e0ec 0x213d57328 0x214281868 0x1f6f2bad4 0x1f71d1d48 0x1f71dd934 0x1f6fc4cd8 0x1f723f5ac 0x1f6f874ac 0x1f6f89c3c 0x1ee9190f0 0x1ee9193b8 0x1e75d65b8 0x1e75d6538 0x1e75d5e1c 0x1e75d0ce8 0x1e75d05b8 0x1e9844584 0x213ecb558 0x104c45634 0x1e7090b94)
libc ++ abi.dylib:以类型为NSException的未捕获异常终止
@IBOutlet weak var webview: UIWebView!
@IBOutlet weak var webView: WKWebView!
@IBOutlet weak var activityindicator: UIActivityIndicatorView!
var currentrideid = ""
var ProductLink = ""
var urlString = ""
override func loadView() {
super.loadView()
webView.navigationDelegate = self
webView.uiDelegate = self
}
override func viewDidLoad() {
super.viewDidLoad()
ProductLink = API_URL.commondomain + "Application/View_Ride_info/\(currentrideid)_\(GlobalVarible.languagecode)"
print(ProductLink)
let url = URL(string: ProductLink)
let request = URLRequest(url: url!)
activityindicator.hidesWhenStopped = true
activityindicator.startAnimating()
webView.load(request)
webView.allowsBackForwardNavigationGestures = true
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {
print(error)
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
activityindicator.stopAnimating()
if let yourTargetUrl = webView.url
{
urlString = yourTargetUrl.absoluteString
print(yourTargetUrl)
}
}
}
答案 0 :(得分:0)
您在检查器中设置的出口不正确。您可能将元素链接到@IBOutlet,然后在代码或检查器中更改了变量的拼写,您已将元素链接到错误的@IBOutlet