1
我開始在本週迅速編程終止和我試圖讓我的應用程序簡單的導航欄。這不是我第一次遇到這個錯誤,也不知道可能會丟失什麼。如果我沒有記錯我勾一切從用戶界面代碼correctrly,但輸出說:線程1:信號SIGABRT的libC++ abi.dylib:與類型NSException(LLDB)的未捕獲的異常
libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
什麼可以是錯誤的?由於
import UIKit
class ViewController: UIViewController {
var t = Timer()
@IBAction func hi(_ sender: Any) {
print("Camera button pressed")
t.invalidate()
}
func processTimer() {
print("1 second has passed")
}
override func viewDidLoad() {
super.viewDidLoad()
t = Timer.scheduledTimer(timeInterval: 1, target: self, selector: Selector(("processTimer")), userInfo: nil, repeats: true)
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
改變了它,但仍然沒有工作,全碼:https://pastebin.com/4bFR2bvM – Marci
可以共享完整的錯誤文本? – Zee
https://pastebin.com/taMssZHT – Marci