在V10.1上启动项目后,Xcode项目抛出NSUnknownKeyException

问题描述 投票:-1回答:1

我在我的旧Mac上有一个Xcode项目,我完成了构建(Xcode版本9.4.1)。它工作正常,可以在AppStore中上传。因为My 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上运行该项目,但它没有用。

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

我还删除了插座的连接并重新连接了它们。它没有任何东西。

先感谢您,

曼努埃尔

swift xcode xcode10 xcode9.4
1个回答
0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.