How do i fix the sigabrt error (Tried Everything)

Hello


i have just created a single view appliation and when i run it it said thread 1 signal sigabrt:


#import <UIKit/UIKit.h>

#import "AppDelegate.h"

int main(int argc, char * argv[]) {

@autoreleasepool {

return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));

}

}

Replies

SIGABRT (signal abort) is the code an app crashes with when an exception (a fatal error) is thrown and not handled. Most likely something is wrong with your storyboard or nib or info.plist. Have a look at this thread, in which I walked another developer through a similar issue:

https://forums.developer.apple.com/message/41967

hi bob


i have tried your other answer and it does not work!!! it was always called main storyboard

OK, so your issue is not the same one as the other one. Do you know how to retrieve the stack trace for the crash? If you could post that, it would be really helpful.

No i dont know how to do that? can you show me

On the first page of the "Xcode Overview" document, there is a screenshot of the entire Xcode workspace. Notice at the bottom, second from the right, a white area with (lldb) in blue. That's the debugger console. Build and run your app, and when you see the SIGABRT crash, copy everything that got printed there and post it here.


This is the link to the Xcode overview:

https://developer.apple.com/library/prerelease/ios/documentation/ToolsLanguages/Conceptual/Xcode_Overview/index.html#//apple_ref/doc/uid/TP40010215

  • Hi! i have the same problem. Can you help me?

  • Hi! i have the same problem. Can you help me?

Add a Comment

ok i think i got it


2015-09-06 14:49:33.220 Flappy Tristram[12807:454955] Unknown class ViewController in Interface Builder file.

2015-09-06 14:49:33.232 Flappy Tristram[12807:454955] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7fdbf2f0fcb0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key HighScore.'

*** First throw call stack:

(

0 CoreFoundation 0x00000001035469b5 __exceptionPreprocess + 165

1 libobjc.A.dylib 0x0000000102fbedeb objc_exception_throw + 48

2 CoreFoundation 0x00000001035465f9 -[NSException raise] + 9

3 Foundation 0x0000000102b8bfdb -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288

4 UIKit 0x0000000103c99418 -[UIViewController setValue:forKey:] + 88

5 UIKit 0x0000000103eac2c7 -[UIRuntimeOutletConnection connect] + 109

6 CoreFoundation 0x0000000103487590 -[NSArray makeObjectsPerformSelector:] + 224

7 UIKit 0x0000000103eaacaa -[UINib instantiateWithOwner:options:] + 1864

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

9 UIKit 0x0000000103ca0720 -[UIViewController loadView] + 178

10 UIKit 0x0000000103ca0a22 -[UIViewController loadViewIfRequired] + 138

11 UIKit 0x0000000103ca1054 -[UIViewController view] + 27

12 UIKit 0x0000000103b8077c -[UIWindow addRootViewControllerViewIfPossible] + 61

13 UIKit 0x0000000103b80e79 -[UIWindow _setHidden:forced:] + 302

14 UIKit 0x0000000103b926dc -[UIWindow makeKeyAndVisible] + 43

15 UIKit 0x0000000103b12d13 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4003

16 UIKit 0x0000000103b1913d -[UIApplication _runWithMainScene:transitionContext:completion:] + 1755

17 UIKit 0x0000000103b16390 -[UIApplication workspaceDidEndTransaction:] + 188

18 FrontBoardServices 0x00000001070ef7ac -[FBSSerialQueue _performNext] + 192

19 FrontBoardServices 0x00000001070efb1a -[FBSSerialQueue _performNextFromRunLoopSource] + 45

20 CoreFoundation 0x0000000103472b21 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

21 CoreFoundation 0x0000000103468a4c __CFRunLoopDoSources0 + 556

22 CoreFoundation 0x0000000103467f03 __CFRunLoopRun + 867

23 CoreFoundation 0x0000000103467918 CFRunLoopRunSpecific + 488

24 UIKit 0x0000000103b15d2d -[UIApplication _run] + 402

25 UIKit 0x0000000103b1a99e UIApplicationMain + 171

26 Flappy Tristram 0x0000000102ab9b6f main + 111

27 libdyld.dylib 0x0000000105d7792d start + 1

28 ??? 0x0000000000000001 0x0 + 1

)

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

(lldb)

Great—that's exactly what I was looking for.


You've got two problems:

1) Your HighScore outlet is either connected improperly or not connected at all.

2) Your nib includes a "ViewController" class that it can't find in your code (this one is less significant, though)

2017-07-12 11:53:05.142 CALCULATOR[1089:26911] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<CALCULATOR.ViewController 0x7fce7040f8e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key didPressSubtract.'

*** First throw call stack:

(

0 CoreFoundation 0x0000000105412b0b __exceptionPreprocess + 171

1 libobjc.A.dylib 0x00000001026b8141 objc_exception_throw + 48

2 CoreFoundation 0x0000000105412a59 -[NSException raise] + 9

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

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

5 UIKit 0x0000000102f92a09 -[UIRuntimeOutletConnection connect] + 109

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

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

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

9 UIKit 0x0000000102d2c8d9 -[UIViewController loadView] + 177

10 UIKit 0x0000000102d2cc0a -[UIViewController loadViewIfRequired] + 195

11 UIKit 0x0000000102d2d45a -[UIViewController view] + 27

12 UIKit 0x0000000102bf598a -[UIWindow addRootViewControllerViewIfPossible] + 65

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

14 UIKit 0x0000000102c08ebe -[UIWindow makeKeyAndVisible] + 42

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

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

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

18 FrontBoardServices 0x0000000106b225f6 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24

19 FrontBoardServices 0x0000000106b2246d -[FBSSerialQueue _performNext] + 186

20 FrontBoardServices 0x0000000106b227f6 -[FBSSerialQueue _performNextFromRunLoopSource] + 45

21 CoreFoundation 0x00000001053b8c01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

22 CoreFoundation 0x000000010539e0cf __CFRunLoopDoSources0 + 527

23 CoreFoundation 0x000000010539d5ff __CFRunLoopRun + 911

24 CoreFoundation 0x000000010539d016 CFRunLoopRunSpecific + 406

25 UIKit 0x0000000102b8408f -[UIApplication _run] + 468

26 UIKit 0x0000000102b8a134 UIApplicationMain + 159

27 CALCULATOR 0x00000001020dc5f7 main + 55

28 libdyld.dylib 0x00000001063b265d start + 1

29 ??? 0x0000000000000001 0x0 + 1

)

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