1

I have recently updated Xcode to use the iOS5 SDK. Since updating my app is crash in at the launch screen. Previously the app ran on both 4.3 and the iPhone(prior to iOS5). The error points to:int retVal = UIApplicationMain(argc, argv, nil, nil); In the main.m

The console returns the following:

GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug  8 20:32:45 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".Attaching to process 3903.
2011-11-13 22:11:05.421 BlastCalc[3903:10d03] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x5c1b600> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key averageChargeLengthLabel.'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x00e7b5a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x00fcf313 objc_exception_throw + 44
    2   CoreFoundation                      0x00e7b4e1 -[NSException raise] + 17
    3   Foundation                          0x0084d677 _NSSetUsingKeyValueSetter + 135
    4   Foundation                          0x0084d5e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
    5   UIKit                               0x002c930c -[UIRuntimeOutletConnection connect] + 112
    6   CoreFoundation                      0x00df18cf -[NSArray makeObjectsPerformSelector:] + 239
    7   UIKit                               0x002c7d23 -[UINib instantiateWithOwner:options:] + 1041
    8   UIKit                               0x002c9ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
    9   UIKit                               0x000cf17a -[UIApplication _loadMainNibFile] + 172
    10  UIKit                               0x000cfcf4 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 291
    11  UIKit                               0x000da617 -[UIApplication handleEvent:withNewEvent:] + 1533
    12  UIKit                               0x000d2abf -[UIApplication sendEvent:] + 71
    13  UIKit                               0x000d7f2e _UIApplicationHandleEvent + 7576
    14  GraphicsServices                    0x0132f992 PurpleEventCallback + 1550
    15  CoreFoundation                      0x00e5c944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    16  CoreFoundation                      0x00dbccf7 __CFRunLoopDoSource1 + 215
    17  CoreFoundation                      0x00db9f83 __CFRunLoopRun + 979
    18  CoreFoundation                      0x00db9840 CFRunLoopRunSpecific + 208
    19  CoreFoundation                      0x00db9761 CFRunLoopRunInMode + 97
    20  UIKit                               0x000cf7d2 -[UIApplication _run] + 623
    21  UIKit                               0x000dbc93 UIApplicationMain + 1160
    22  BlastCalc                           0x00002979 main + 121
    23  BlastCalc                           0x000028f5 start + 53
    24  ???                                 0x00000001 0x0 + 1
)
terminate called throwing an exceptionsharedlibrary apply-load-rules all
(gdb)

I have been reading a lot of fixes relating to this in older Xcode versions and SDKs however, I have not been able to find the fix to my issue. I am not highly proficient at iOS and the change to 5 has thrown me.

If anyone can point me in the direction of an answer that would be appreciated. Thank you all in advance.

Currently I am butchering my app to death and have almost decided to can it and recode from the start. I have attempted this once, however the whole storyboard thing has made it difficult.

chin-apse
  • 25
  • 5
  • In addition the app is no not working at all. Even when restoring from a snapshot that was known to work. Cheers – chin-apse Nov 13 '11 at 14:41
  • possible duplicate of [What does this mean? "'NSUnknownKeyException', reason: ... This class is not key value coding-compliant for the key X"](http://stackoverflow.com/questions/3088059/what-does-this-mean-nsunknownkeyexception-reason-this-class-is-not-key) – jtbandes Aug 03 '15 at 06:19

2 Answers2

1

I was getting the same error and i fixed it by re-creating a previous connection. The background its this: i create a (iphone) single view application and added a map view to may view controller. I just run the app i got some error. Trying to fix it, i dragged the map view to the view controller to create outlets. Meanwhile this didnt solved i deleted the outlets and all the code created. After bypass that error, i got this one. As told i fixed it by re-creating the map view outlets.

Now, this isnt a good way to function. Looks like it keeps some cache. I would be good to know how to reset/clean this situation.

Hope it helps. Thanks!

Nuno Lucas
  • 83
  • 7
0

I just ran in to this same problem. I finally got around it by doing this:

  1. For your averageChargeLength label, use the Xcode interface builder (either by selecting the storyboard or the xib) and open the connections panel. With the storyboard, you can just control-click on it to get the connections panel open.
  2. Delete all of the outlet connections there by mousing over the connection and clicking the tiny x.
  3. Try to run your app again in the simulator. For me, that allowed my app to run without the exception but the label didn't update anymore.
  4. If it works, then go back in Xcode interface builder and try to re-create the connection you meant to create by dragging the connection back into the ViewController.h file. Make sure to check the equivalent .m file for duplicated code from the connection insertion and remove it.
  5. Try to run your app again. For me, instead of failing as before, it actually ran.

The reason it had been failing for me before is that I tried to connect a button to the wrong thing. I deleted the thing it was connected to, but never checked the interface builder to make sure that the connection was gone as well.

Jay R.
  • 31,911
  • 17
  • 52
  • 61
  • Cheers for the response. I got to that point as well. I suppose I should of updated my question with my solution. – chin-apse Mar 01 '12 at 13:54