i am setting up a userdefualt integer and when i segue to the page the app crashes. It shows the appDelegate with it says " Thread 1: signal SIGBART" and in the debugger it says "libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) "
Her is my code, please help me find the error:
class home: UIViewController {
@IBOutlet weak var fiveth1: UILabel!
@IBOutlet weak var iron1: UILabel!
@IBOutlet weak var gold1: UILabel!
@IBOutlet weak var ships1: UILabel!
@IBOutlet weak var empires1: UIWebView!
@IBOutlet weak var webViewG: UIWebView!
override func viewDidLoad() {
super.viewDidLoad()
let htmlPath1 = Bundle.main.path(forResource: "WebViewContent2", ofType: "html")
let htmlURL1 = URL(fileURLWithPath: htmlPath1!)
let html1 = try? Data(contentsOf: htmlURL1)
self.webViewG.load(html1!, mimeType: "text/html", textEncodingName: "UTF-8", baseURL: htmlURL1.deletingLastPathComponent())
if (Fiveth.value(forKey: "Fiveth") != nil){
fiveth = Fiveth.value(forKey: "Fiveth") as! NSInteger!
fiveth1.text = NSString(format: "Fiveth: %i", fiveth) as String
}
fiveth1.text = "\(Fiveth)"
}