**HELP** App keeps crashing whenever I try to run in simulator.

Discussion in 'iOS Programming' started by roddymunro, Mar 6, 2014.

  1. roddymunro, Mar 6, 2014
    Last edited by a moderator: Mar 6, 2014

    roddymunro macrumors newbie

    Joined:
    Mar 6, 2014
    #1
    App is a simple 'test you knowledge' app.

    This is what I keep getting:

    Code:
    2014-03-06 21:38:17.241 A2 Computing Quiz[1058:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x15d460f0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key answerField.'
    *** First throw call stack:
    (0x2d5afe83 0x379106c7 0x2d5afb89 0x2deef3b7 0x2df00ffd 0x2d51f7e9 0x300934df 0x30094d2b 0x2ffad0a7 0x2fd9ea53 0x2fd39a07 0x2fd38cfd 0x2fd9e321 0x3221876d 0x32218357 0x2d57a777 0x2d57a713 0x2d578edf 0x2d4e3471 0x2d4e3253 0x2fd9d5c3 0x2fd98845 0xac059 0x37e09ab7)
    libc++abi.dylib: terminating with uncaught exception of type NSException
    Not sure what's going on. Can supply additional code if needed. Thanks!
     
  2. blueroom macrumors 603

    blueroom

    Joined:
    Feb 15, 2009
    Location:
    Toronto, Canada
    #2
    OSX version? Which Mac? Everything up to date?
     
  3. roddymunro thread starter macrumors newbie

    Joined:
    Mar 6, 2014
    #3
    Mavericks 10.9.2 - Xcode is all up to date too
     
  4. JohnsonK macrumors regular

    Joined:
    Mar 6, 2014
    #4
    You did not supply any details or code.

    We are programmers, not wizards :)
     
  5. roddymunro, Mar 6, 2014
    Last edited by a moderator: Mar 6, 2014

    roddymunro thread starter macrumors newbie

    Joined:
    Mar 6, 2014
    #5
    Oops. That was what was in the debug area at the time. Getting a different result now:

    Code:
    2014-03-06 22:27:56.322 A2 Computing Quiz[617:70b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x8f744d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key answerField.'
    *** First throw call stack:
    (
    	0   CoreFoundation                      0x023645e4 __exceptionPreprocess + 180
    	1   libobjc.A.dylib                     0x014be8b6 objc_exception_throw + 44
    	2   CoreFoundation                      0x023f46a1 -[NSException raise] + 17
    	3   Foundation                          0x00f729ee -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
    	4   Foundation                          0x00edecfb _NSSetUsingKeyValueSetter + 88
    	5   Foundation                          0x00ede253 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
    	6   Foundation                          0x00f4070a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
    	7   UIKit                               0x002c1a15 -[UIRuntimeOutletConnection connect] + 106
    	8   libobjc.A.dylib                     0x014d07d2 -[NSObject performSelector:] + 62
    	9   CoreFoundation                      0x0235fb6a -[NSArray makeObjectsPerformSelector:] + 314
    	10  UIKit                               0x002c056e -[UINib instantiateWithOwner:options:] + 1417
    	11  UIKit                               0x002c22fb -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 165
    	12  UIKit                               0x0001f3bb -[UIApplication _loadMainNibFileNamed:bundle:] + 58
    	13  UIKit                               0x0001f6e9 -[UIApplication _loadMainInterfaceFile] + 245
    	14  UIKit                               0x0001e28f -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 543
    	15  UIKit                               0x0003287c -[UIApplication handleEvent:withNewEvent:] + 3447
    	16  UIKit                               0x00032de9 -[UIApplication sendEvent:] + 85
    	17  UIKit                               0x00020025 _UIApplicationHandleEvent + 736
    	18  GraphicsServices                    0x022c22f6 _PurpleEventCallback + 776
    	19  GraphicsServices                    0x022c1e01 PurpleEventCallback + 46
    	20  CoreFoundation                      0x022dfd65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
    	21  CoreFoundation                      0x022dfa9b __CFRunLoopDoSource1 + 523
    	22  CoreFoundation                      0x0230a77c __CFRunLoopRun + 2156
    	23  CoreFoundation                      0x02309ac3 CFRunLoopRunSpecific + 467
    	24  CoreFoundation                      0x023098db CFRunLoopRunInMode + 123
    	25  UIKit                               0x0001dadd -[UIApplication _run] + 840
    	26  UIKit                               0x0001fd3b UIApplicationMain + 1225
    	27  A2 Computing Quiz                   0x0000265d main + 141
    	28  libdyld.dylib                       0x0598f701 start + 1
    )
    libc++abi.dylib: terminating with uncaught exception of type NSException
    (lldb)
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    Yes, but you still have not provided any code. The first thing a person debugging this is going to want to do is: look at the code where this exception is occurring. So, please be considerate of those you seek help from and provide the code as well. Thank you.
     
  7. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #7
    My guess is that you have set up an instance variable and connected an IB item to it, then went and renamed the ivar. You have a disconnection between the interface file and its corresponding source file.

    Click on the Files Owner and review the Outlets section for a connection to an outlet named answerField.
     

Share This Page