signal sigabrt error?

I have created an iOS application in Swift and am getting the following error on the line where my class is declared: Thread 1: Signal SIGABRT


@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {  //ERROR ON THIS LINE: THREAD 1: SIGNAL SIGABRT
   
    var window: UIWindow?
    var navController: UINavigationController?
    var isNetworkAvailable: Bool = true
    var intPage: Int = 0
   
    var hostReachability: Reachability?
    var internetReachability: Reachability?
    var wifiReachability: Reachability?
     // all the methods of the class
}


I do not understand what the error is And after doing some research I still confused. What does this error mean and how do I solve it? Thank you, help appreciated.

A SIGABRT (signal abort) error means that the app was deliberately crashed due to some really bad problem, like a runtime error during the start-up sequence or a bad or unreadable user interface file. The reason you see the instruction pointer over the class declaration is that the problem is not directly related to any line of code you've written, so Xcode has nothing relevant to show you. Instead, the error is being triggered deep within the Cocoa software, meaning you probably have some sort of configuration issue in your app's info or a problem with the storyboard.


Usually, an informational message is printed in the debugger console when this error occurs. If you can retrieve that and post it here, I'll help you figure out what's wrong.

Ok thank you. Here is the error message.


*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[IOTAlertSwift.AppDelegate reachabilityChanged]: unrecognized selector sent to instance 0x7f9231512f60'

*** First throw call stack:

(

0 CoreFoundation 0x000000010629be65 __exceptionPreprocess + 165

1 libobjc.A.dylib 0x0000000105d14deb objc_exception_throw + 48

2 CoreFoundation 0x00000001062a448d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205

3 CoreFoundation 0x00000001061f190a ___forwarding___ + 970

4 CoreFoundation 0x00000001061f14b8 _CF_forwarding_prep_0 + 120

5 CoreFoundation 0x000000010626869c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12

6 CoreFoundation 0x00000001062683db _CFXRegistrationPost + 427

7 CoreFoundation 0x0000000106268142 ___CFXNotificationPost_block_invoke + 50

8 CoreFoundation 0x00000001062ad972 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1986

9 CoreFoundation 0x0000000106163279 _CFXNotificationPost + 633

10 Foundation 0x00000001058a3109 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66

11 IOTAlertSwift 0x00000001052612f3 ReachabilityCallback + 979

12 SystemConfiguration 0x0000000106f33c95 reachPerformAndUnlock + 255

13 CoreFoundation 0x00000001061c7a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

14 CoreFoundation 0x00000001061bd95c __CFRunLoopDoSources0 + 556

15 CoreFoundation 0x00000001061bce13 __CFRunLoopRun + 867

16 CoreFoundation 0x00000001061bc828 CFRunLoopRunSpecific + 488

17 GraphicsServices 0x000000010a099ad2 GSEventRunModal + 161

18 UIKit 0x0000000106fb8610 UIApplicationMain + 171

19 IOTAlertSwift 0x0000000105293dbd main + 109

20 libdyld.dylib 0x0000000108ba792d start + 1

)

libc++abi.dylib: terminating with uncaught exception of type NSException

(lldb)


Im guessing its because the unrecognized selector.

Yep, "unrecognized selector" is totally correct. From reading your call stack, I see that the notification mechanism is trying to call your app delegate's reachabilityChanged() function, which apparently doesn't exist. It looks to me like you made a mistake when setting up the notification observer. Since the observer function takes a notification parameter, you need to write the selector as "reachabilityChanged:" instead of "reachabilityChanged" . Once you make that change, it should all work.


By the way, you've run into one of the clumsy vestiges of traditional Cocoa. All the new safety-oriented language features in Swift are nice, but these good old APIs are still really easy to get wrong, as you've discovered. 🙂

hey bob, can i have your email address? I have a similar SIGABRT error during my tutorial. I cant post here due to ' invalid character ' which i have no idea how to get rid of it. Could you please help me on this? Appreciate it much. THANKS

Sorry, but I don't give out my email address. Do keep trying to get it to work, though. You're running into some dumb restrictions intended to keep spammers from posting their phone numbers and other contact information. It's likely complaining about the memory addresses in the call stack. Try posting just the error message and not the call stack.


Oh, and since SIGABRT errors arise for a variety of reasons, you should probably start another thread to keep the topics separate.

Let me give it a try (here's from above):


*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[IOTAlertSwift.AppDelegate reachabilityChanged]: unrecognized selector sent to instance 0x7f9231512f60'

*** First throw call stack:

(

0 CoreFoundation __exceptionPreprocess + 165

1 libobjc.A.dylib objc_exception_throw + 48

2 CoreFoundation -[NSObject(NSObject) doesNotRecognizeSelector:] + 205

3 CoreFoundation ___forwarding___ + 970

4 CoreFoundation _CF_forwarding_prep_0 + 120

5 CoreFoundation __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12

6 CoreFoundation _CFXRegistrationPost + 427

7 CoreFoundation ___CFXNotificationPost_block_invoke + 50

8 CoreFoundation -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1986

9 CoreFoundation _CFXNotificationPost + 633

10 Foundation -[NSNotificationCenter postNotificationName:object:userInfo:] + 66

11 IOTAlertSwift ReachabilityCallback + 979

12 SystemConfiguration reachPerformAndUnlock + 255

13 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

14 CoreFoundation __CFRunLoopDoSources0 + 556

15 CoreFoundation __CFRunLoopRun + 867

16 CoreFoundation CFRunLoopRunSpecific + 488

17 GraphicsServices GSEventRunModal + 161

18 UIKit UIApplicationMain + 171

19 IOTAlertSwift main + 109

20 libdyld.dylib start + 1

)

Yeah, it wouldn't let me post either with the 0x00.. pointer addresses in the call stack. Remove those and you should be just fine.

Need a bit of help as well. Got the same thread1 sigabrt error. Hope you can help! Here is my code -



import UIKit

@UIApplicationMain

class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

/

return true

}

func applicationWillResignActive(application: UIApplication) {

/

/

}

func applicationDidEnterBackground(application: UIApplication) {

/

/

}

func applicationWillEnterForeground(application: UIApplication) {

/

}

func applicationDidBecomeActive(application: UIApplication) {

/

}

func applicationWillTerminate(application: UIApplication) {

/

}

}



and Here is my error message -



2016-05-07 20:17:48.053 User-Pwd 2[58970:364513] -[User_Pwd_2.LoginVC textUsername:]: unrecognized selector sent to instance 0x7fd661e19f00

2016-05-07 20:17:48.060 User-Pwd 2[58970:364513] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[User_Pwd_2.LoginVC textUsername:]: unrecognized selector sent to instance 0x7fd661e19f00'

*** First throw call stack:

(

0 CoreFoundation 0x00000001051d2d85 __exceptionPreprocess + 165

1 libobjc.A.dylib 0x0000000106f76deb objc_exception_throw + 48

2 CoreFoundation 0x00000001051dbd3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205

3 CoreFoundation 0x0000000105121cfa ___forwarding___ + 970

4 CoreFoundation 0x00000001051218a8 _CF_forwarding_prep_0 + 120

5 UIKit 0x00000001059fca8d -[UIApplication sendAction:to:from:forEvent:] + 92

6 UIKit 0x0000000105b6fe67 -[UIControl sendAction:to:forEvent:] + 67

7 UIKit 0x0000000105b70143 -[UIControl _sendActionsForEvents:withEvent:] + 327

8 UIKit 0x00000001063f96c5 -[UITextField _resignFirstResponder] + 298

9 UIKit 0x0000000105c0ea1a -[UIResponder _finishResignFirstResponder] + 292

10 UIKit 0x00000001063f94ef -[UITextField _finishResignFirstResponder] + 49

11 UIKit 0x0000000105c0eac9 -[UIResponder resignFirstResponder] + 140

12 UIKit 0x00000001063f93bc -[UITextField resignFirstResponder] + 136

13 UIKit 0x0000000105c0e777 -[UIResponder becomeFirstResponder] + 362

14 UIKit 0x0000000105aa4151 -[UIView(Hierarchy) becomeFirstResponder] + 138

15 UIKit 0x00000001063f8186 -[UITextField becomeFirstResponder] + 51

16 UIKit 0x0000000105efc6db -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) setFirstResponderIfNecessary] + 287

17 UIKit 0x0000000105f0019a -[UITextInteractionAssistant(UITextInteractionAssistant_Internal) oneFingerTap:] + 3817

18 UIKit 0x0000000105ef2b28 _UIGestureRecognizerSendTargetActions + 153

19 UIKit 0x0000000105eef19a _UIGestureRecognizerSendActions + 162

20 UIKit 0x0000000105eed197 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 843

21 UIKit 0x0000000105ef5655 ___UIGestureRecognizerUpdate_block_invoke898 + 79

22 UIKit 0x0000000105ef54f3 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 342

23 UIKit 0x0000000105ee2e75 _UIGestureRecognizerUpdate + 2634

24 UIKit 0x0000000105a6f48e -[UIWindow _sendGesturesForEvent:] + 1137

25 UIKit 0x0000000105a706c4 -[UIWindow sendEvent:] + 849

26 UIKit 0x0000000105a1bdc6 -[UIApplication sendEvent:] + 263

27 UIKit 0x00000001059f5553 _UIApplicationHandleEventQueue + 6660

28 CoreFoundation 0x00000001050f8301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

29 CoreFoundation 0x00000001050ee22c __CFRunLoopDoSources0 + 556

30 CoreFoundation 0x00000001050ed6e3 __CFRunLoopRun + 867

31 CoreFoundation 0x00000001050ed0f8 CFRunLoopRunSpecific + 488

32 GraphicsServices 0x0000000109868ad2 GSEventRunModal + 161

33 UIKit 0x00000001059faf09 UIApplicationMain + 171

34 User-Pwd 2 0x0000000104fe76d2 main + 114

35 libdyld.dylib 0x0000000107a3a92d start + 1

)

libc++abi.dylib: terminating with uncaught exception of type NSException

(lldb)

Could I trouble you to re-post this in a new thread? This one's been around for a while and there are a ton of reasons why exceptions occur, so you're likely to have an entirely separate issue.

Ok no problem

O que causou isto em meu caso, foi uma LABEL que eu havia utilizado e excluir antes de desligar a ligação com o .swift.


Para resolver eu recriei a Label no storyboard reconectei com o .swift, exclui a conexão e depois apaguei do storyboard.

I don't quite have idea why, but I have the problem, thread 1

import UIKit
import CoreData
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate { //where it highlights in red and say thread one.
    var window: UIWindow?
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        /
        return true
    }
    func applicationWillResignActive(_ application: UIApplication) {
        /
        /
    }
    func applicationDidEnterBackground(_ application: UIApplication) {
        /
        /
    }
    func applicationWillEnterForeground(_ application: UIApplication) {
        /
    }
    func applicationDidBecomeActive(_ application: UIApplication) {
        /
    }
    func applicationWillTerminate(_ application: UIApplication) {
        /
        /
        self.saveContext()
    }
    / 
    lazy var persistentContainer: NSPersistentContainer = {
        /
         The persistent container for the application. This implementation
         creates and returns a container, having loaded the store for the
         application to it. This property is optional since there are legitimate
         error conditions that could cause the creation of the store to fail.
        */
        let container = NSPersistentContainer(name: "Stopwatch")
        container.loadPersistentStores(completionHandler: { (storeDescription, error) in
            if let error = error as NSError? {
                /
                /
                
                /
                 Typical reasons for an error here include:
                 * The parent directory does not exist, cannot be created, or disallows writing.
                 * The persistent store is not accessible, due to permissions or data protection when the device is locked.
                 * The device is out of space.
                 * The store could not be migrated to the current model version.
                 Check the error message to determine what the actual problem was.
                 */
                fatalError("Unresolved error \(error), \(error.userInfo)")
            }
        })
        return container
    }()
    / 
    func saveContext () {
        let context = persistentContainer.viewContext
        if context.hasChanges {
            do {
                try context.save()
            } catch {
                /
                /
                let nserror = error as NSError
                fatalError("Unresolved error \(nserror), \(nserror.userInfo)")
            }
        }
    }
}

2017-04-20 16:06:35.981 Stopwatch[28694:1863534] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Stopwatch.ViewController 0x7fe82f50a180> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key start.'

*** First throw call stack:

(

0 CoreFoundation 0x0000000102ad0b0b __exceptionPreprocess + 171

1 libobjc.A.dylib 0x0000000102121141 objc_exception_throw + 48

2 CoreFoundation 0x0000000102ad0a59 -[NSException raise] + 9

3 Foundation 0x0000000101c36e8b -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292

4 UIKit 0x000000010308d8e4 -[UIViewController setValue:forKey:] + 87

5 UIKit 0x00000001032fa86d -[UIRuntimeOutletConnection connect] + 109

6 CoreFoundation 0x0000000102a76e8d -[NSArray makeObjectsPerformSelector:] + 269

7 UIKit 0x00000001032f9223 -[UINib instantiateWithOwner:options:] + 1856

8 UIKit 0x0000000103093f13 -[UIViewController _loadViewFromNibNamed:bundle:] + 381

9 UIKit 0x0000000103094829 -[UIViewController loadView] + 177

10 UIKit 0x0000000103094b5a -[UIViewController loadViewIfRequired] + 195

11 UIKit 0x00000001030953aa -[UIViewController view] + 27

12 UIKit 0x0000000102f5ee26 -[UIWindow addRootViewControllerViewIfPossible] + 65

13 UIKit 0x0000000102f5f50c -[UIWindow _setHidden:forced:] + 294

14 UIKit 0x0000000102f7235a -[UIWindow makeKeyAndVisible] + 42

15 UIKit 0x0000000102eebb1f -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4346

16 UIKit 0x0000000102ef1d84 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1709

17 UIKit 0x0000000102eeef93 -[UIApplication workspaceDidEndTransaction:] + 182

18 FrontBoardServices 0x00000001069c05f6 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24

19 FrontBoardServices 0x00000001069c046d -[FBSSerialQueue _performNext] + 186

20 FrontBoardServices 0x00000001069c07f6 -[FBSSerialQueue _performNextFromRunLoopSource] + 45

21 CoreFoundation 0x0000000102a76c01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

22 CoreFoundation 0x0000000102a5c0cf __CFRunLoopDoSources0 + 527

23 CoreFoundation 0x0000000102a5b5ff __CFRunLoopRun + 911

24 CoreFoundation 0x0000000102a5b016 CFRunLoopRunSpecific + 406

25 UIKit 0x0000000102eed82f -[UIApplication _run] + 468

26 UIKit 0x0000000102ef38d4 UIApplicationMain + 159

27 Stopwatch 0x0000000101b46417 main + 55

28 libdyld.dylib 0x000000010623365d start + 1

)

libc++abi.dylib: terminating with uncaught exception of type NSException

(lldb)

Hello everyone.


I just had the same problem, and reading this forum I could solve it, and I want to share exactly what happend to me may it can help to some one else.


I was makin a calculator app, and a couple of my objects were buttoms and one of them was a label, I made a mistake sharing two times the same action to the same label, what I mean, I just did two times the same process (I don´t know why). So when I runned the app on my iphone (just tried), I´ve got this same error code.


So to solve it, I just deleted the action, deleted the label, and a create againg the label, and shared the action again.


Thanks to every one againg.


Regards.

signal sigabrt error?
 
 
Q