【问题标题】:Xcode project throws NSUnknownKeyException after starting project on Version 10.1Xcode 项目在版本 10.1 上启动项目后抛出 NSUnknownKeyException
【发布时间】:2019-03-03 10:53:12
【问题描述】:

我在完成构建的旧 Mac 上有一个 Xcode 项目(Xcode 版本 9.4.1)。在那里它工作正常,它已准备好在 AppStore 中上传。因为我的 Mac 无法运行 macOS mojave,所以当我在那里运行项目时,我借用了另一台具有最新 Xcode 版本 (10.1) 的 Mac,我收到以下异常:

2019-03-03 11:21:20.941643+0100 Schoolcheck_Schüler[6018:110054] libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform.

2019-03-03 11:21:21.052628+0100 Schoolcheck_Schüler[6018:110054] Unknown class _TtC20Schoolcheck_Schüler12ChooseSchool in Interface Builder file.

2019-03-03 11:21:21.086624+0100 Schoolcheck_Schüler[6018:110054] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7fbab841cf20> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key LabelSchoolName.'

*** First throw call stack:

(

0   CoreFoundation                      0x0000000110e761bb __exceptionPreprocess + 331

1   libobjc.A.dylib                     0x0000000110414735 objc_exception_throw + 48

2   CoreFoundation                      0x0000000110e75d29 -[NSException raise] + 9

3   Foundation                          0x000000010fe3fde4 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292

4   UIKitCore                           0x0000000116708292 -[UIViewController setValue:forKey:] + 87

5   UIKitCore                           0x000000011699f573 -[UIRuntimeOutletConnection connect] + 109

6   CoreFoundation                      0x0000000110e61cfd -[NSArray makeObjectsPerformSelector:] + 317

7   UIKitCore                           0x000000011699c2b9 -[UINib instantiateWithOwner:options:] + 1814

8   UIKitCore                           0x000000011670f452 -[UIViewController _loadViewFromNibNamed:bundle:] + 383

9   UIKitCore                           0x000000011670fddc -[UIViewController loadView] + 177

10  UIKitCore                           0x00000001167100ee -[UIViewController loadViewIfRequired] + 175

11  UIKitCore                           0x0000000116710940 -[UIViewController view] + 27

12  UIKitCore                           0x0000000116d67c53 -[UIWindow addRootViewControllerViewIfPossible] + 122

13  UIKitCore                           0x0000000116d6836e -[UIWindow _setHidden:forced:] + 294

14  UIKitCore                           0x0000000116d7b5c0 -[UIWindow makeKeyAndVisible] + 42

15  UIKitCore                           0x0000000116d28833 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4595

16  UIKitCore                           0x0000000116d2dc2f -[UIApplication _runWithMainScene:transitionContext:completion:] + 1623

17  UIKitCore                           0x000000011654c4e9 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866

18  UIKitCore                           0x000000011655529c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153

19  UIKitCore                           0x000000011654c126 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 233

20  UIKitCore                           0x000000011654cae0 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1085

21  UIKitCore                           0x000000011654acb5 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 795

22  UIKitCore                           0x000000011654a95f -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 435

23  UIKitCore                           0x000000011654fa90 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 584

24  UIKitCore                           0x000000011655080e _performActionsWithDelayForTransitionContext + 100

25  UIKitCore                           0x000000011654f7ef -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 221

26  UIKitCore                           0x000000011655493a -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392

27  UIKitCore                           0x0000000116d2c44e -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515

28  UIKitCore                           0x00000001168d0d09 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 357

29  FrontBoardServices                  0x000000011d8dd2da -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448

30  FrontBoardServices                  0x000000011d8e8443 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 271

31  FrontBoardServices                  0x000000011d8e7b3a __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53

32  libdispatch.dylib                   0x00000001143e3602 _dispatch_client_callout + 8

33  libdispatch.dylib                   0x00000001143e6b78 _dispatch_block_invoke_direct + 301

34  FrontBoardServices                  0x000000011d91cba8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30

35  FrontBoardServices                  0x000000011d91c860 -[FBSSerialQueue _performNext] + 457

36  FrontBoardServices                  0x000000011d91ce40 -[FBSSerialQueue _performNextFromRunLoopSource] + 45

37  CoreFoundation                      0x0000000110ddb721 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17

38  CoreFoundation                      0x0000000110ddaf93 __CFRunLoopDoSources0 + 243

39  CoreFoundation                      0x0000000110dd563f __CFRunLoopRun + 1263

40  CoreFoundation                      0x0000000110dd4e11 CFRunLoopRunSpecific + 625

41  GraphicsServices                    0x000000011a9361dd GSEventRunModal + 62

42  UIKitCore                           0x0000000116d2f81d UIApplicationMain + 140

43  Schoolcheck_SchuÃàler               0x000000010f95f494 main + 68

44  libdyld.dylib                       0x0000000114459575 start + 1

)

libc++abi.dylib: terminating with uncaught exception of type NSException

(lldb) 

我在外置硬盘上的旧 Mac 上运行了该项目,它运行良好。之后,我尝试在外部硬盘驱动器上的较新 Mac 上运行该项目,但没有成功。

我检查了所有班级,每个班级都连接正确。

我还删除了插座的连接并重新连接它们。它什么也没改变。

提前谢谢你,

曼努埃尔

【问题讨论】:

    标签: swift xcode xcode10 xcode9.4


    【解决方案1】:

    根据您的崩溃日志。很有可能从您的代码中删除了名为 LabelSchoolName 的 IBOutLet。你可以看看 UIViewController 引用它并重新添加。

    【讨论】:

    • 我注意到这里有两个问题。关于使用Unknown class in interface builder file 构建失败。这可能会有所帮助:stackoverflow.com/questions/24924966/…
    • 问题是我的名字中有一个德国元音变音(ü),一旦我把它改成 ue 就可以了。
    猜你喜欢
    • 2020-10-28
    • 2023-02-17
    • 1970-01-01
    • 2014-09-20
    • 2013-04-16
    • 1970-01-01
    • 2011-11-14
    • 2018-10-15
    • 2019-06-09
    相关资源
    最近更新 更多