奇怪的错误/ SIGABRT线程1

时间:2016-10-20 01:47:00

标签: ios swift xcode

StoryBoard

我复制了文件夹后,我的代码中出现了几个奇怪的错误,我删除了副本,但我还有一些错误 ...

  运行时出现线程1 SIGABRT错误,构建完成但没有加载。   错误与AppDelegate类

一致
import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    return true
}

func applicationWillResignActive(_ application: UIApplication) {
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}

func applicationDidEnterBackground(_ application: UIApplication) {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

func applicationWillEnterForeground(_ application: UIApplication) {
    // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}

func applicationDidBecomeActive(_ application: UIApplication) {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

func applicationWillTerminate(_ application: UIApplication) {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

另一个错误在于图像。

感谢您的帮助。Build Failed 1 error

error after adding exception breakpoint

Console

3 个答案:

答案 0 :(得分:0)

  1. 当您从Xcode中删除文件时,您应该选择“移至废纸篓”。您可以再次将其添加到Xcode,然后使用“移至废纸篓”将其删除。

  2. 转到“断点导航器”,单击底部的“+”按钮,选择“异常断点...”。当崩溃再次发生时,Xcode应该停在您的异常代码中。

答案 1 :(得分:0)

ViewController中有一个Unreferred Outlet,右键单击你的开始ViewController并确保Outlets前面没有感叹号

答案 2 :(得分:0)

转到构建阶段 - >编译源代码,看看该应用程序是否有两个“ViewController.swift”文件。如果是,请删除您不想要的那个。

希望这能帮到你!