gpt4 book ai didi

ios - 我如何摆脱这个 Sigabrt 错误?我尝试了多种方法

转载 作者:行者123 更新时间:2023-11-28 08:46:19 24 4
gpt4 key购买 nike

所以我是 xcode 编程的新手。我一周前才开始,但一直在看编码视频和编码示例。我在这方面的背景知识很少,但我正在寻找更多关于编码的知识。

现状

我正在开发我的应用程序并尝试通过 Iphone 5s 模拟器对其进行模拟。我的主视图 Controller 通过 UIButton 链接到第二个 View Controller 。当我按下按钮时,没有任何反应,我收到一条红色的小警告:

class AppDelegate: UIResponder, UIApplicationDelegate {    

在它说“UIResponder 的地方,它会说”“线程 1:信号 SIGABRT”这就是我的 viewcontroller.swift 编辑器的样子:

//
// ViewController.swift
// QuoteDaily
//
// Created by Jordan Norris on 2/5/16.
// Copyright © 2016 Jordan Norris. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

@IBOutlet weak var Button: UIButton!

override func viewDidLoad() {
super.viewDidLoad()


}


override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}


}

到目前为止我做了什么

我查看了类似这样的其他帖子,答案是摆脱可能导致此问题的任何挥之不去的 socket 和未连接的东西,所以我摆脱了每个 socket 和连接并开始“新鲜”。唯一的问题是,当我添加一个按钮转到第二个 ViewController,“FirstQuestion.swift”时,它会显示相同的错误。

我也重启了很多次xcode和重启模拟器很多次都弹出同样的错误。

问题

我要问的是如何摆脱这个错误,以便我可以按下这个按钮将我带到第二个 View Controller ?

我有2张图片供引用

Assistant text editor for first view controller

View Controller number 1(with the button) and view controller 2(When is your birthday) Also the triggered segues and referencing outlets on the left side

如果有人能帮助我,我将不胜感激,因为我不想放弃刚刚开始的事情。此外,这个社区似乎是一个非常友好的社区,所以我很乐意回到这个来源寻求进一步的帮助。谢谢。

最佳答案

Select Your second viewController to which the button is pointing and check all the outlets connections you have made by going to Show the connections inspector. Sometimes there are some previously connected outlet or actions names that you may have changed, that may cause crash.

删除所有连接,然后通过选择显示助理编辑器 重新连接它们。如果有帮助,请清理代码并再次运行项目。

关于ios - 我如何摆脱这个 Sigabrt 错误?我尝试了多种方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35249385/

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