0

For some reason when I run my app , the app crashes then in Xcode it takes me to app delegate. The error message is given to me at the top(where "the class AppDelegate: UIResponder, UIApplicationDelegate" is). The error message is "Thread 1: Signal SIGABRT". As I am only a novice in programming, I have no idea what this means, and have found no help online. Here are screenshots of what I get in Xcode. This is not the duplicate of the other problem, because my problem was why Xcode takes me to app delegate and shows me the SIGABRT ERROR. I just didn't know what I was supposed to do after that.FYI-I did not know in the console errors pop up thereenter image description here

enter image description here

This is what is my console:

2017-01-23 17:58:27.966 TIP CALCULATOR[53908:2610390] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<TIP_CALCULATOR.ViewController 0x7fbc53d0add0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key calculateButtonPressed.'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010a9a9d4b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x000000010788321e objc_exception_throw + 48
    2   CoreFoundation                      0x000000010a9a9c99 -[NSException raise] + 9
    3   Foundation                          0x00000001073919df -[NSObject(NSKeyValueCoding) setValue:forKey:] + 291
    4   UIKit                               0x000000010830e293 -[UIViewController setValue:forKey:] + 88
    5   UIKit                               0x000000010858279e -[UIRuntimeOutletConnection connect] + 109
    6   CoreFoundation                      0x000000010a94e9e0 -[NSArray makeObjectsPerformSelector:] + 256
    7   UIKit                               0x0000000108581122 -[UINib instantiateWithOwner:options:] + 1867
    8   UIKit                               0x00000001083149c5 -[UIViewController _loadViewFromNibNamed:bundle:] + 386
    9   UIKit                               0x00000001083152e7 -[UIViewController loadView] + 177
    10  UIKit                               0x000000010831561c -[UIViewController loadViewIfRequired] + 201
    11  UIKit                               0x0000000108315e70 -[UIViewController view] + 27
    12  UIKit                               0x00000001081df4b5 -[UIWindow addRootViewControllerViewIfPossible] + 71
    13  UIKit                               0x00000001081dfc06 -[UIWindow _setHidden:forced:] + 293
    14  UIKit                               0x00000001081f3519 -[UIWindow makeKeyAndVisible] + 42
    15  UIKit                               0x000000010816bf8d -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4818
    16  UIKit                               0x00000001081720ed -[UIApplication _runWithMainScene:transitionContext:completion:] + 1731
    17  UIKit                               0x000000010816f26d -[UIApplication workspaceDidEndTransaction:] + 188
    18  FrontBoardServices                  0x000000010c10f6cb __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
    19  FrontBoardServices                  0x000000010c10f544 -[FBSSerialQueue _performNext] + 189
    20  FrontBoardServices                  0x000000010c10f8cd -[FBSSerialQueue _performNextFromRunLoopSource] + 45
    21  CoreFoundation                      0x000000010a94e761 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    22  CoreFoundation                      0x000000010a93398c __CFRunLoopDoSources0 + 556
    23  CoreFoundation                      0x000000010a932e76 __CFRunLoopRun + 918
    24  CoreFoundation                      0x000000010a932884 CFRunLoopRunSpecific + 420
    25  UIKit                               0x000000010816daea -[UIApplication _run] + 434
    26  UIKit                               0x0000000108173c68 UIApplicationMain + 159
    27  TIP CALCULATOR                      0x000000010729cf9f main + 111
    28  libdyld.dylib                       0x000000010b95968d start + 1
    29  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 
tj75467
  • 103
  • 1
  • 8
  • Is anything printed to the console? – Ollie Jan 23 '17 at 14:02
  • 4
    Add exception breakpoint as well, it might lead you to the cause of the issue – Miknash Jan 23 '17 at 14:05
  • As @Miknash says: http://stackoverflow.com/a/17802942/691977 – jalone Jan 23 '17 at 14:34
  • I am not a Swift programmer, this might be a dumb comment, but your your "var tipamount" and "totalcost" are declared outside of viewdidload and you are setting values to them, is this possible in swift? or this might be your problem for the crash? –  Jan 23 '17 at 14:56
  • I am pretty sure that is allowed – tj75467 Jan 23 '17 at 14:57
  • Can I get in trouble for that – tj75467 Jan 23 '17 at 15:04
  • where is your `calculateButtonPressed` outlet? seemingly your class has none; so you may need to disconnect that from IB as well... otherwise it will crash like this. – holex Jan 23 '17 at 15:07
  • My problem now is that when I open assistant editor, this internal class thing pops up, so I cannot create IB Outlets – tj75467 Jan 23 '17 at 15:11

1 Answers1

0

Check if there are non valid connections between your UI elements and code in the connections inspectorstoryboard connections inspector

Martijn
  • 43
  • 1
  • 1
  • 7