gpt4 book ai didi

swift - 线程 1 : signal SIGABRT libc++abi. dylib:以 NSException 类型的未捕获异常终止 (lldb)

转载 作者:可可西里 更新时间:2023-11-01 00:56:23 25 4
gpt4 key购买 nike

本周我开始快速编程,并尝试在我的应用程序中制作一个简单的导航栏。这不是我第一次遇到这个错误,也不知道会遗漏什么。如果我没记错的话,我会正确地 Hook 从用户界面到代码的所有内容,但输出显示:

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.
}

最佳答案

问题出在链接到大量 IBAction 的 minus10Button - 其中一些不存在。因此,在 Interface Builder 中右键单击 minus10Button 并删除旧的和不相关的链接,解决了这个问题。

关于swift - 线程 1 : signal SIGABRT libc++abi. dylib:以 NSException 类型的未捕获异常终止 (lldb),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46832170/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com