2016-04-22 105 views
0

當我嘗試訪問我的應用程序的某些部分時,我的應用程序顯示此錯誤。此外,它不顯示此錯誤,當我嘗試在iPhone 6s模擬器上運行它,但在所有其他模擬器上顯示它Xcode:威脅1:Sigabrt錯誤

我正在使用Firebase作爲我的後端。

這裏是表示錯誤 [應用代表屏幕快照]

enter image description here

這裏是預先我AppDelegate

import UIKit 
import Firebase 

var UID : String? 
var EMAIL: String? 
var PASSWORD: String? 
var NOTIFICATIONS: Int? 
var SAMPLENO: Int? 

let userData = NSUserDefaults.standardUserDefaults(); 

struct Keys { 
    static let UID = "UID"; 
    static let EMAIL = "Email"; 
    static let PASSWORD = "Password"; 
    static let SAMPLENO = "SampleNo"; 
    static let AGE = "Age"; 
    static let WAKEUP = "WakeUpTime" 
    static let SLEEP = "SleepTime"; 
    static let NOTIFICATIONS = "Notifications"; 
    static let ACTIVITIES = "Activities"; 
    static let ACTIVITYCOUNT = "ActivityCount"; 
    static let DISTRACTEDCOUNT = "DistractedCount" 
    static let ACTIVITYFOCUSLEVEL = "ActivityFocusLevel"; 
    static let INTERVALMIDDLES = "Interval"; 
    static let INTERVALERROR = "Error"; 
    static let TOTALFOCUS = "Focus"; 
} 

@UIApplicationMain 
class AppDelegate: UIResponder, UIApplicationDelegate { 

    var window: UIWindow? 


    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { 
     // Override point for customization after application launch. 
     UINavigationBar.appearance().barTintColor = UIColor(red: 20/255.0, green: 36/255.0, blue: 141/255.0, alpha: 1) 

     UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor(), NSFontAttributeName: UIFont(name: "HelveticaNeue-Light", size: 19.0)!] 

     UIBarButtonItem.appearance().tintColor = UIColor.whiteColor() 

     UINavigationBar.appearance().tintColor = UIColor.whiteColor() 

     Firebase.defaultConfig().persistenceEnabled = true 

     return true 
    } 






    // Function deals with notification if app is in the foreground 
    func application(application: UIApplication, didReceiveLocalNotification notification: UILocalNotification) { 
     // Do something serious in a real app. 
//  print("Received Local Notification:") 
//  print(notification.alertBody) 
    } 


    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:. 
    } 


} 

感謝的我的AppDelegate屏幕截圖。

+0

添加異常斷點並檢查您的應用程序崩潰的位置 – Lion

回答

0

請檢查所有連接以確保您的所有IBOutletsIBActions連接正確,並且沒有任何舊的,刪除或修改的變量遺留的連接。

+0

我會這麼做......但我仍然不知道它爲什麼適用於iPhone 6s模擬器,但不適用於其他應用程序。你知道爲什麼會發生這種情況嗎? –