简体   繁体   中英

Thread 1: Signal SIGABRT In AppDelegate when you run it

My app delegate gets the following when you try to run it:

Thread 1:signal SIGABRT

The issue happens when you run the app but sometimes it changes to a breakpoint error, please help me

Does anyone know how to fix this issue. My AppDelegate code is posted below;

 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 } 

When I get SIGABRT or EXECBREAKBOINT (or similar) error, it is almost always a Storyboard connection that I forgot to remove or connect properly. If you rename an Outlet or Action, or delete it from the code, but not delete the connection from your Label/Button/Whatever, this will happen.

I don't know why it shows the AppDelegate when the error occurs, though, but it always does.

Nothing wrong with the delegate code, if that's all.

Update:

Alright, you haven't got enough rep to chat yet but I found your main error: If you click the blue icon at the top in the file browser, that says "GymAmigo" and go to the "General" tab your Main Interface is set to iPhone. Change it to Main.Storyboard, in the dropdown. Then you have some other problems. I suggest you set the Register or Login controller to the Initial View Controller, in the attributes inspector to the right, when in Main.Storyboard, that works and it runs in the simulator.

If you set your Main view (TableViewController) to the initial, you will get crashes because of unwrapping nil values. This is because the PFUser.currentUser() doesn't include all the columns for the user (if I'm not wrong, you can test if it works for you, I don't have your class design).

Activate your console when debugging, (View/Debug Area/Activate Console). There you will get error messages, more easily to understand than "SIGARBT".

Btw, if you feel like skipping the whole registration/login process for now, Parse has a great UI you can implement. https://parse.com/docs/ios/guide#user-interface

Looks like you have a lingering connection to a no-longer-existent outlet . Perhaps you deleted a textField that you previously set up?

Ctrl-/right-click on the File's Owner in the Xcode editor, look for a warning triangle. Clear that out (by deleting the connection or re-connecting it to the proper outlet) and you'll likely be good.

You click the the yellow dot that is on top of every view controller.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM