【问题标题】:Simulator of Xcode Projects is blank [duplicate]Xcode项目的模拟器是空白的[重复]
【发布时间】:2018-06-18 20:37:16
【问题描述】:

如上所述,在我参加的其中一门课程中,当我运行我的项目时,模拟器会打开应用程序,该应用程序似乎是空白的。 我已经查看了许多与我有同样问题的人的帖子,但我尝试了他们的解决方案,但没有成功。

我审查的解决方案是: - 擦除模拟器的所有内容 - 更改了模拟器的类型(从 iPhone 8 plus 到 iPhone 7 plus) - 确保我在 Info.plist 上有正确的设置 - 从头开始​​构建不同时间的程序作为新程序。 可能还有一些我什至不记得了。

我附上了我的文件,以及我的模拟器启动应用程序时打开的页面。 (最后一张截图)

这是错误日志

2018-06-18 22:52:29.685489+0200 Bullseye[2247:47563] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Bullseye.ViewController 0x7fc0df70bf90> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key numValue.'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010625e1e6 __exceptionPreprocess + 294
    1   libobjc.A.dylib                     0x0000000102665031 objc_exception_throw + 48
    2   CoreFoundation                      0x000000010625e0b9 -[NSException raise] + 9
    3   Foundation                          0x0000000102086b47 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
    4   UIKit                               0x000000010309cec0 -[UIViewController setValue:forKey:] + 87
    5   UIKit                               0x000000010338ae8a -[UIRuntimeOutletConnection connect] + 109
    6   CoreFoundation                      0x0000000106200e8d -[NSArray makeObjectsPerformSelector:] + 317
    7   UIKit                               0x0000000103389834 -[UINib instantiateWithOwner:options:] + 1856
    8   UIKit                               0x00000001030a40d7 -[UIViewController _loadViewFromNibNamed:bundle:] + 383
    9   UIKit                               0x00000001030a4a04 -[UIViewController loadView] + 177
    10  UIKit                               0x00000001030a4d21 -[UIViewController loadViewIfRequired] + 175
    11  UIKit                               0x00000001030a5574 -[UIViewController view] + 27
    12  UIKit                               0x0000000102f73123 -[UIWindow addRootViewControllerViewIfPossible] + 122
    13  UIKit                               0x0000000102f73834 -[UIWindow _setHidden:forced:] + 294
    14  UIKit                               0x0000000102f865cc -[UIWindow makeKeyAndVisible] + 42
    15  UIKit                               0x0000000102efa3da -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4739
    16  UIKit                               0x0000000102eff5cb -[UIApplication _runWithMainScene:transitionContext:completion:] + 1677
    17  UIKit                               0x00000001032c1f7e __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
    18  UIKit                               0x0000000103694a39 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
    19  UIKit                               0x00000001032c1bba -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
    20  UIKit                               0x00000001032c23db -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 675
    21  UIKit                               0x0000000103c33614 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 299
    22  UIKit                               0x0000000103c334ae -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
    23  UIKit                               0x000000010391775d __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
    24  UIKit                               0x0000000103b124b7 _performActionsWithDelayForTransitionContext + 100
    25  UIKit                               0x0000000103917627 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
    26  UIKit                               0x00000001036940e0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
    27  UIKit                               0x0000000102efdeac -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
    28  UIKit                               0x00000001034d0bcb -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
    29  FrontBoardServices                  0x000000010828d2f3 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 331
    30  FrontBoardServices                  0x0000000108295cfa __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 225
    31  libdispatch.dylib                   0x00000001073c27ec _dispatch_client_callout + 8
    32  libdispatch.dylib                   0x00000001073c7db8 _dispatch_block_invoke_direct + 592
    33  FrontBoardServices                  0x00000001082c1470 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
    34  FrontBoardServices                  0x00000001082c112e -[FBSSerialQueue _performNext] + 439
    35  FrontBoardServices                  0x00000001082c168e -[FBSSerialQueue _performNextFromRunLoopSource] + 45
    36  CoreFoundation                      0x0000000106200bb1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    37  CoreFoundation                      0x00000001061e54af __CFRunLoopDoSources0 + 271
    38  CoreFoundation                      0x00000001061e4a6f __CFRunLoopRun + 1263
    39  CoreFoundation                      0x00000001061e430b CFRunLoopRunSpecific + 635
    40  GraphicsServices                    0x0000000108b56a73 GSEventRunModal + 62
    41  UIKit                               0x0000000102f01057 UIApplicationMain + 159
    42  Bullseye                            0x0000000101d5bad7 main + 55
    43  libdyld.dylib                       0x000000010743f955 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

【问题讨论】:

  • 你能显示整个错误日志吗?
  • @VasilGarov 我在主帖中添加了整个错误日志。必须说最后一个截图是我点击屏幕才弹出来的。
  • 好的,你在哪里使用'numValue'?
  • 查看我的更新答案。

标签: ios swift xcode xcode9.4


【解决方案1】:

这可能是因为您的插座连接不良。审查他们。如果您在视图控制器中更改了它们,您仍然需要在情节提要中更新它们。

【讨论】:

    【解决方案2】:

    模拟器是空白的,因为您的应用程序正在崩溃。检查您的故事板插座连接以确保它们都已连接。打开连接检查器并注意是否有任何断开的连接。如果您的连接正确,则应填充视图控制器中的圆圈(见下图)

    【讨论】:

    • 这很奇怪.. 从我在主帖中附加的屏幕截图中可以看出,圆圈没有填充。但是现在他们已经被填满了。
    • Xcode 有时会出现这种情况,但问题现在解决了吗?
    • 肯定不会,同样的错误又来了。我将连接检查员的菜单附加到我的主帖子中,希望这可能会有所帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-03-10
    • 1970-01-01
    • 2017-09-19
    • 2016-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多