0

I am getting this error message in my AppDelegate.h after I run my application. "Thread 1: signal SIGABRT" I have commented where the error is occurring to the side of my code. Can anybody help please. Thanks.

#import <UIKit/UIKit.h>

#import "AppDelegate.h"

int main(int argc, char * argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); //Thread 1: signal SIGABRT
    }
}

Here is the stack trace I'm getting:

2014-03-29 17:27:56.440 Game[3599:70b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x109c28520> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000101c1b795 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x0000000101725991 objc_exception_throw + 43
    2   CoreFoundation                      0x0000000101c9fe69 -[NSException raise] + 9
    3   Foundation                          0x000000010130703a -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
    4   CoreFoundation                      0x0000000101c17700 -[NSArray makeObjectsPerformSelector:] + 224
    5   UIKit                               0x00000001005d11b8 -[UINib instantiateWithOwner:options:] + 1131
    6   UIKit                               0x00000001005d2bb2 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 138
    7   UIKit                               0x000000010038781d -[UIApplication _loadMainNibFileNamed:bundle:] + 42
    8   UIKit                               0x0000000100386b1a -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 454
    9   UIKit                               0x0000000100397aab -[UIApplication handleEvent:withNewEvent:] + 3092
    10  UIKit                               0x0000000100397f1e -[UIApplication sendEvent:] + 79
    11  UIKit                               0x00000001003882be _UIApplicationHandleEvent + 618
    12  GraphicsServices                    0x0000000104977bb6 _PurpleEventCallback + 762
    13  GraphicsServices                    0x000000010497767d PurpleEventCallback + 35
    14  CoreFoundation                      0x0000000101b9d819 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
    15  CoreFoundation                      0x0000000101b9d5ee __CFRunLoopDoSource1 + 478
    16  CoreFoundation                      0x0000000101bc6ab3 __CFRunLoopRun + 1939
    17  CoreFoundation                      0x0000000101bc5f33 CFRunLoopRunSpecific + 467
    18  UIKit                               0x00000001003864bd -[UIApplication _run] + 609
    19  UIKit                               0x0000000100388043 UIApplicationMain + 1010
    20  Game                                0x0000000100000f33 main + 115
    21  libdyld.dylib                       0x00000001032755fd start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Alfonso
  • 8,386
  • 1
  • 43
  • 63
  • add an exception breakpoint, this might give you more of an indication of where the error is actually happening. Look at the call stack in the left part of your xcode screen, this will also give you a better indication. – Pruthvikar Mar 29 '14 at 22:51
  • Is this a follow-up question to this one [here](http://stackoverflow.com/questions/22737673/missing-at-start-of-message-send-expression)? If so, could you please post the stack trace you posted there in here? – Alfonso Mar 29 '14 at 22:53
  • I dont know what stack trace is. Yes it is a follow up. Sorry I am new to xcode I have tried researching everything but I still have not found a solution. – user3466875 Mar 29 '14 at 22:56
  • Also I have another question is there away to link a button in a XIB to a viewcontroller in a storyboard. – user3466875 Mar 29 '14 at 22:57
  • No problem, I will edit the questions then and link this one. As for your next question, please create another question for this (like you did with this one). – Alfonso Mar 29 '14 at 22:58
  • Okay I will create another question. – user3466875 Mar 29 '14 at 22:59
  • I will inform you when that question has been created. – user3466875 Mar 29 '14 at 23:00
  • I guess your nib file is sort of invalid. The cocoa touch framework tries to access some object's `view` property but the acutal object does not have a `view` property. I don't know. Maybe you managed to key in some class name as view controller which actually is no view controller. So your "next question" regarding the xib for some button which you try linking to a view controller may be the place where the mess came up. – Hermann Klecker Mar 29 '14 at 23:07
  • Have you removed a property from a class and forgotten to remove the setting of that in a nib file? – Rhythmic Fistman Mar 29 '14 at 23:08
  • The object which causes the exception is the `UIApplication` instance. This is usually the file owner of the main XIB/NIB. Do you see an outlet connection in this XIB file between the `UIApplication` and a view? – Alfonso Mar 29 '14 at 23:13
  • To check your outlets, right click on an object in the Interface Builder and look if there is a warning icon somewhere. – Alfonso Mar 29 '14 at 23:15
  • http://stackoverflow.com/questions/22738179/link-a-button-in-a-xib-to-a-viewcontroller-in-a-storboard – user3466875 Mar 29 '14 at 23:20

1 Answers1

0
Game[3599:70b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x109c28520> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'

The above line means that you have are trying to access a property called view, but your class doesn't have a property of that name. Either you are calling view property on an object that doesn't actually have a view (but this is more likely to be caught by the compiler), or you haven't set the view outlet for your view controller in Interface Builder.

Check that the view controller you are loading in your App Delegate has the view outlet connected in IB.

jancakes
  • 456
  • 4
  • 10
  • 1
    Actually based on the error message it's not the class `Game` but the class `UIApplication`. Game seems to be the application name. – Alfonso Mar 29 '14 at 23:12