2016-10-20 61 views
0

StoryBoard奇怪的錯誤/ SIGABRT線程1

幾個奇怪的錯誤出現在我的代碼後,我做了一個文件夾的副本,我刪除重複的,但我有一些錯誤剩餘..

線程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

+0

也許原始文件仍然以某種方式被引用。嘗試刪除它們並將其添加回 – Alexander

回答

0
  1. 當你刪除Xcode中的文件時,你應該選擇「移動到回收站」。你可以直接將其添加到Xcode中再次,並刪除它使用「移動垃圾「。

  2. 轉到「Breakpoint navigator」,點擊底部的「+」按鈕,選擇「Exception Breakpoint ...」。當崩潰再次發生時,Xcode應停止在您的異常代碼。

+0

我這樣做了,它在AppDelegate的類聲明中顯示了一個綠色的斷點行。我添加了照片到帖子 – xteetsx

+0

沒有斷點,我可以在代碼中找到 – xteetsx

+0

檢查Xcode控制檯窗口,它記錄「未知類....」。首先,您需要檢查Xcode中是否有「ProficiencyPart」類。如果沒有「ProficiencyPart」類,則需要檢查故事板以查找哪個視圖控制器爲「ProficiencyPart」,然後將視圖控制器的自定義類更改爲默認值。 –

0

有一個Unreferred出口在你的視圖控制器,鼠標右鍵點擊你開始的ViewController並確保沒有在出口之前

0

前往構建階段沒有感嘆號 - >編譯源代碼,看看是否該應用程序有兩個「ViewController.swift」文件。如果是刪除你不想要的那個。

希望這可以幫助你!