My browser based on WebKit crashes when I try to load http://a/%%30%30 with exception "Unexpectedly found nil while unwrapping an Optional value".
@IBOutlet weak var webView: WKWebView! webView.uiDelegate = self webView.navigationDelegate = self webView.customUserAgent = Browser.UserAgent() let config = webView.configuration config.applicationNameForUserAgent = Browser.name config.preferences.javaScriptEnabled = true webView.scrollView.delegate = self webView.scrollView.isScrollEnabled = true webView.scrollView.keyboardDismissMode = .onDrag
The crash actually occurs when I return the URL value:
if fullURL.contains("http://") || fullURL.contains("https://") { return URL(string: query)! }
And then the webpage is loaded:
webView.load(url)
I have removed the "!" from the return function of the URL and I am required to provide a default value or force-unwrap, which leads to a crash.
Is this a problem with my code or with WebKit?
Post
Replies
Boosts
Views
Activity
Every time I build my app, at the first compile since Xcode launched, I see this screen, and Xcode is stuck here for any time between 5 and 30 minutes, and I'm not even developing an Apple Watch app:
I have seen similar articles, but with no real resolution. After googling for a few minutes, this should happen when the OS is updated, but it happens literally when compiling any app for the first time since opening Xcode, and it also wastes a hell lot of time, because I cannot even edit code while waiting. Any tips?
I keep getting this error:
As far as I know, iOS 15.4.1 is compatible with Xcode 13.3.1.
This has been occurring for the last 3 days, with restarting the Mac not helping at all. Luck is the only way to compile my app on a physical iPhone without seeing this. Are there any possible fixes or workarounds?