【问题标题】:Thread 1: signal SIGABRT - AppDelegate.h线程 1:信号 SIGABRT - AppDelegate.h
【发布时间】:2014-07-17 18:05:03
【问题描述】:
//
//  main.m
//  Journey
//
//  Created by Julian Buscema on 2014-07-13.
//  Copyright (c) 2014 Julian Buscema. All rights reserved.
//

#import <UIKit/UIKit.h>

#import "AppDelegate.h"

int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}

当我尝试运行我的应用程序时,我的 main.m 打开并且“return UIApplicationMain....”行以绿色突出显示线程 1:信号 SIGABRT。我用谷歌搜索它,它说它与我的 AppDelegate.h 文件有关,但它的哪一部分?

这里是:

//
//  AppDelegate.h
//  Journey
//
//  Created by Julian Buscema on 2014-07-13.
//  Copyright (c) 2014 Julian Buscema. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end

【问题讨论】:

标签: ios objective-c


【解决方案1】:

你的错误是this class is not key value coding-compliant for the key username.

名为username. 的元素有问题您是否创建了从 Storyboard 到 ViewController 的出口?如果你这样做了,你是否重命名了 ViewController 中的属性?

尝试右键单击 UITextField 并检查网点。空的白色圆圈表示你的插座坏了,它一定是白色的。

【讨论】:

  • imgur.com/xlrXo0K 我将两个图像都放在了两个用户名文本字段中。所以我不确定在发现错误后我应该做什么......我很抱歉所有问题。
  • @Julian 不要抱歉。你有3个场景。请对每一项进行相同的右键单击检查。
  • 感谢您的耐心等待,我真的很感激。第三个场景是空白的,只是一个图像。这是我的 ViewController 的:pastebin.com/zEaLVF3X, pastebin.com/Gx5wYktQ
  • 我从图片中看到了 2 个网点。一个称为用户名,第二个称为用户名字段。删除名为“用户名”的出口。在情节提要中,将您的嘴悬停在上面,然后单击“x”按钮。我在您的 ViewController 中看到名为 usernameField 的 IBOutlet。没有名为“用户名”的属性。在 Storyboard 中,您正在引用 ViewController 中不再存在的名为“用户名”的属性。
  • 好的,我删除了用户名引用,但现在我得到了一个新的崩溃原因。 imgur.com/r2GxpG4
猜你喜欢
  • 1970-01-01
  • 2021-05-29
  • 1970-01-01
  • 1970-01-01
  • 2018-11-05
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多