xcode 6.1 (Swift) 中的 SIGABRT 运行时错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26540170/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:58:51  来源:igfitidea点击:

SIGABRT runtime error in xcode 6.1 (Swift)

iosxcodeswiftsigabrt

提问by john lemer

The only change that have been made to the code from the initial have been made in ViewControl.swift

对初始代码所做的唯一更改已在ViewControl.swift 中进行

override func viewDidLoad() {
    newMessage.hidden = true

    super.viewDidLoad()
    // 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.
}


@IBOutlet weak var newMessage: UILabel!

@IBOutlet var newButton: UIButton!

@IBAction func newButtonAction(sender: UIButton) {
    newMessage.hidden = false
    }
}

yet I'm getting a SIGABRTerror in AppDelegate.swifton

但我得到一个SIGABRT错误AppDelegate.swift

class AppDelegate: UIResponder, UIApplicationDelegate {

Is this an Xcode 6.1error or is there something wrong with my code?

这是Xcode 6.1错误还是我的代码有问题?

回答by Hayley Guillou

There is most likely something fishy going on in you xib/storyboard. Check the connections to make sure all your IBOutletsand IBActionsare connected correctly and that there aren't any connections left over from old, deleted or modified variables.

你的 xib/storyboard 很可能有一些可疑的东西。检查连接,以确保所有的IBOutletsIBActions被正确连接,并且没有任何连接旧,删除或修改变量遗留下来的。

Other than that, it's hard to say without more information. Check out thisand thisfor more help.

除此之外,没有更多信息就很难说。查看这个这个以获得更多帮助。

回答by Zorayr

Seems like Xcode doesn't break at the exception point - look into the error console for more information. See photo to see which window to select (it's the blue icon on the right).

似乎 Xcode 不会在异常点中断 - 查看错误控制台以获取更多信息。查看照片以查看要选择的窗口(右侧的蓝色图标)。

enter image description here

在此处输入图片说明