2015-07-20 80 views
1

我的應用程序的委託獲得以下當您嘗試運行它:線程1:信號SIGABRT在AppDelegate中,當你運行它

主題1:信號SIGABRT

當你運行應用程序,但有時問題發生它更改爲斷點錯誤,請幫助我

有誰知道如何解決此問題。我的AppDelegate代碼在下面發佈;

import UIKit 
 

 
@UIApplicationMain 
 
class AppDelegate: UIResponder, UIApplicationDelegate { 
 

 
    var window: UIWindow? 
 

 

 
    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 
 
     Parse.enableLocalDatastore() 
 
     
 
     // Initialize Parse. 
 
     Parse.setApplicationId("XXXXXXXXXXXXXXXX", 
 
      clientKey: "XXXXXXXXXXXXXXXXXXXXX") 
 
     
 
     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 throttle down OpenGL ES frame rates. 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 inactive 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:. 
 
    } 
 

 
    // MARK: - Split view 
 

 
    
 
      }

+0

當出現錯誤時,您是否在Xcode調試窗口中看到任何其他消息? –

+0

沒有@PhillipMills – user4174219

回答

2

當我SIGABRT或EXECBREAKBOINT(或類似)錯誤,它幾乎總是一個故事板連接,我忘了取出或連接正確。如果您重命名Outlet或Action,或將其從代碼中刪除,但不會從標籤/按鈕/無論刪除連接,都會發生。

我不知道爲什麼它顯示錯誤發生時的AppDelegate,但它總是如此。

委託代碼沒有問題,如果是這樣。

更新:

好吧,你沒有足夠的代表又聊天,但我發現你的主要錯誤: 如果單擊在文件瀏覽器頂部,上面寫着「GymAmigo」藍色圖標,進入「常規」選項卡,將主界面設置爲iPhone。在下拉菜單中將其更改爲Main.Storyboard。那麼你還有其他一些問題。我建議你將Register或Login控制器設置爲初始視圖控制器,在Main.Storyboard中右側的屬性檢查器中,該控制器工作並在模擬器中運行。

如果將主視圖(TableViewController)設置爲初始值,則會由於展開nil值而導致崩潰。這是因爲PFUser.currentUser()不包含用戶的所有列(如果我沒有錯,你可以測試它是否適用於你,我沒有你的類設計)。

調試時激活控制檯(View/Debug Area/Activate Console)。在那裏你會得到錯誤信息,比「SIGARBT」更容易理解。

順便說一句,如果你現在想跳過整個註冊/登錄過程,Parse就可以實現一個很棒的UI。 https://parse.com/docs/ios/guide#user-interface

+0

我似乎找不到任何。有沒有找到他們@mattias – user4174219

+0

有可能是一種方式,但我不知道。你可以選擇黃色的東西,選擇整個ViewController,然後檢查連接標籤。 – Mattias

+0

http://i.imgur.com/24zJoeK.png在這個例子中,頂部出口(由信息文本覆蓋)是一個錯誤,containerView出口也被打破了(「藥丸」形狀的東西,而不是一個實心的圓形) )。 – Mattias