ios 应用程序在加载时崩溃并以 NSException 类型的未捕获异常终止

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22774652/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 23:52:42  来源:igfitidea点击:

App crashing on load terminating with uncaught exception of type NSException

iosobjective-cxcode

提问by user3246508

I have been playing around with a project of mine tonight and now I can't get it to load up. Strange thing is I have got an older version of this and have even tried to copy all data across and still not loading.

今晚我一直在玩我的一个项目,现在我无法加载它。奇怪的是我有一个旧版本,甚至试图复制所有数据但仍然没有加载。

Error I am getting in NSLogis as follows:

我进入的错误NSLog如下:

2014-04-01 01:24:53.513 Adult Game[47180:a0b] CUICatalog: Invalid asset name supplied: , or invalid scale factor: 2.000000
2014-04-01 01:24:53.515 Adult Game[47180:a0b] Could not load the "" image referenced from a nib in the bundle with identifier "DannyLinton.Adult-Game"
2014-04-01 01:24:53.519 Adult Game[47180:a0b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x8e35860> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key animate.'
*** First throw call stack:
(
    0   CoreFoundation                      0x0196f5e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x016f28b6 objc_exception_throw + 44
    2   CoreFoundation                      0x019ff6a1 -[NSException raise] + 17
    3   Foundation                          0x013b39ee -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
    4   Foundation                          0x0131fcfb _NSSetUsingKeyValueSetter + 88
    5   Foundation                          0x0131f253 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
    6   Foundation                          0x0138170a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
    7   UIKit                               0x00702a15 -[UIRuntimeOutletConnection connect] + 106
    8   libobjc.A.dylib                     0x017047d2 -[NSObject performSelector:] + 62
    9   CoreFoundation                      0x0196ab6a -[NSArray makeObjectsPerformSelector:] + 314
    10  UIKit                               0x0070156e -[UINib instantiateWithOwner:options:] + 1417
    11  UIKit                               0x00573605 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
    12  UIKit                               0x00573dad -[UIViewController loadView] + 302
    13  UIKit                               0x005740ae -[UIViewController loadViewIfRequired] + 78
    14  UIKit                               0x005745b4 -[UIViewController view] + 35
    15  UIKit                               0x0049c9fd -[UIWindow addRootViewControllerViewIfPossible] + 66
    16  UIKit                               0x0049cd97 -[UIWindow _setHidden:forced:] + 312
    17  UIKit                               0x0049d02d -[UIWindow _orderFrontWithoutMakingKey] + 49
    18  UIKit                               0x004a789a -[UIWindow makeKeyAndVisible] + 65
    19  UIKit                               0x0045acd0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1851
    20  UIKit                               0x0045f3a8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
    21  UIKit                               0x0047387c -[UIApplication handleEvent:withNewEvent:] + 3447
    22  UIKit                               0x00473de9 -[UIApplication sendEvent:] + 85
    23  UIKit                               0x00461025 _UIApplicationHandleEvent + 736
    24  GraphicsServices                    0x031042f6 _PurpleEventCallback + 776
    25  GraphicsServices                    0x03103e01 PurpleEventCallback + 46
    26  CoreFoundation                      0x018ead65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
    27  CoreFoundation                      0x018eaa9b __CFRunLoopDoSource1 + 523
    28  CoreFoundation                      0x0191577c __CFRunLoopRun + 2156
    29  CoreFoundation                      0x01914ac3 CFRunLoopRunSpecific + 467
    30  CoreFoundation                      0x019148db CFRunLoopRunInMode + 123
    31  UIKit                               0x0045eadd -[UIApplication _run] + 840
    32  UIKit                               0x00460d3b UIApplicationMain + 1225
    33  Adult Game                          0x00007dad main + 141
    34  libdyld.dylib                       0x02df2725 start + 0
    35  ???                                 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Any help would be very much appreciated.

任何帮助将不胜感激。

回答by drewag

You have a phantom connection in your StoryBoard or XIB file called "animate".

您的 StoryBoard 或 XIB 文件中有一个名为“animate”的虚拟连接。

  1. Open your StoryBoard / XIB file
  2. If you are using a StoryBoard, select the AdultGame view controller
  3. Click on the "File's Owner" along the left
  4. Select "View > Utilities > Show Connections Inspector"
  5. You will see a list of "Outlets". One of them will be called "animate" and have an exclamation point next to it. Click on the little "x" to delete it.
  1. 打开您的 StoryBoard / XIB 文件
  2. 如果您使用的是 StoryBoard,请选择 AdultGame 视图控制器
  3. 单击左侧的“文件所有者”
  4. 选择“查看 > 实用工具 > 显示连接检查器”
  5. 您将看到一个“Outlets”列表。其中之一将被称为“动画”,并且旁边有一个感叹号。单击小“x”将其删除。