I'm a beginner at Swift.
This time, I created a simple browser using Swift from iOS.
AppDelegate.swift
@UIAapplicationMain
classAppDelegate —UIResponder, UIApplicationDelegate
An error statement similar to the following occurred on the line:
Thread 1: signal SIGABRT
What is the cause?
Below is the source code for viewController.swift
.Xcode is version 9.0beta, Swift3.
import UIKit
classViewController:UIViewController {
@IBOutlet weak varurlTextField: UITextField!
@IBOutletweak var browserWebView:UIWebView!
@IBOutlet weak var backButton: UIBarButtonItem!
@IBOutlet weak var forwardButton: UIBarButtonItem!
@IBOutlet weak var reloadButton: UIBarButtonItem!
override func viewDidLoad(){
super.viewDidLoad()
leturlString="http://dotinstall.com"
let urlRequest=URLRequest(url:URL(string:urlString)!)
self.browserWebView.loadRequest(urlRequest)
// Do any additional setup after loading the view, typically from anib.
}
override funcdidReceiveMemoryWarning(){
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@ IBAction func goBack(_sender:Any){
}
@ IBAction funcgoForward(_sender:Any){
}
@ IBAction func reload(_sender:Any){
}
}
An error similar to the following occurs:
2017-07-07 11:10:19.864054+0900 MyBrowserApp [74215:10111362] [Snapshotting] Snapshoting a view(0x7ffdade10c70,_UIButtonBarStackView) that is not been rendered at least once requirements afterScreenUpdate: YES.
2017-07-07 11:10:22.310946+0900 MyBrowserApp [74215:10111675][ ] network_config_register_boringssl_log_debug_updates Failed to register for BoringSSL log debug updates
2017-07-07 11:10:24.343312+0900 MyBrowserApp [74215:10111688] WF: === Starting WebFilter logging for process MyBrowserApp
2017-07-07 11:10:24.343518 +0900 MyBrowserApp [74215:10111688] WF:_userSettingsForUser:(null)
2017-07-07 11:10:24.343758 + 0900 MyBrowserApp [74215:10111688] WF:_WebFilterIsActive returning: NO
2017-07-07 11:10:25.109372+0900 MyBrowserApp [74215:10111682][ ] network_config_register_boringssl_log_debug_updates Failed to register for BoringSSL log debug updates
2017-07-07 11:10:25.334517 + 0900 MyBrowserApp [74215:10111677][ ] network_config_register_boringssl_log_debug_updates Failed to register for BoringSSL log debug updates
2017-07-07 11:10:25.445752+0900 MyBrowserApp [74215:10111677][ ] network_config_register_boringssl_log_debug_updates Failed to register for BoringSSL log debug updates
2017-07-07 11:10:25.553913+0900 MyBrowserApp [74215:10111676][ ] network_config_register_boringssl_log_debug_updates Failed to register for BoringSSL log debug updates
SIGABRT appears to have been caused by changing the variable name after dragging the UI part into the code with ctrl+drag.
I deleted all the actions and outlets that I might have set on the storyboard and tried to re-establish the connection, and the problem was resolved.The warnings "top layout decremented sinceios 11.0" and "bottom layout decremented sinceios 11.0" that continue to appear afterwards often occur when adding restrictions in Autolayout, and can be resolved by manually pasting the restrictions on the Interface Builder.
© 2024 OneMinuteCode. All rights reserved.