簡體   English   中英

當沒有網絡連接時,iOS應用程序在啟動時崩潰

[英]iOS app crashing on startup when there is no network connection

正如標題所說,如果沒有互聯網連接/飛機模式 ,我的應用程序會在運行時立即崩潰。 問題是,當我設置斷點時,它甚至不能用於我的任何代碼。 不會調用單個viewDidLoad甚至AppDelegate函數,並且錯誤消息似乎與沒有網絡連接有關:

2019-03-21 10:30:20.193955-0500 AppName [98957:977030] ***由於未捕獲的異常'NSInternalInconsistencyException'而終止應用程序,原因:'無法在bundle中加載NIB:'NSBundle <bundleFilePath>(已加載)'名字'BYZ-38-t0r-view-8bC-Xf-vdC''

(我顯然在他們的隱私中插入了一些假值)

調用堆棧:

*** First throw call stack:
(
0   CoreFoundation                      0x00000001036cb1bb __exceptionPreprocess + 331
1   libobjc.A.dylib                     0x0000000102c69735 objc_exception_throw + 48
2   CoreFoundation                      0x00000001036cb015 +[NSException raise:format:] + 197
3   UIKitCore                           0x00000001088edd94 -[UINib instantiateWithOwner:options:] + 497
4   UIKitCore                           0x0000000108661452 -[UIViewController _loadViewFromNibNamed:bundle:] + 383
5   UIKitCore                           0x0000000108661ddc -[UIViewController loadView] + 177
6   UIKitCore                           0x00000001086620ee -[UIViewController loadViewIfRequired] + 175
7   UIKitCore                           0x0000000108662940 -[UIViewController view] + 27
8   UIKitCore                           0x000000010858134c -[UIPresentationController __sizeClassPair] + 62
9   UIKitCore                           0x0000000108675428 -[UIViewController _presentViewController:withAnimationController:completion:] + 2300
10  UIKitCore                           0x000000010867874b __63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 99
11  UIKitCore                           0x0000000108678dd9 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 511
12  UIKitCore                           0x00000001086786b1 -[UIViewController _presentViewController:animated:completion:] + 173
13  UIKitCore                           0x00000001086789f0 -[UIViewController presentViewController:animated:completion:] + 150
14  AppName                        0x0000000100f1125e $SSo16UIViewControllerC12DataScoutProE27showDismissiveAlertMesssage7messageySS_tF + 254
15  AppName                        0x0000000100e58a97 $S12AppName18HomeViewControllerC10commonInit33_90D4AB13D5DB6EAFA2D0742F81F552BALLyyF + 727
16  AppName                        0x0000000100e58462 $S12AppName18HomeViewControllerC5coderACSgSo7NSCoderC_tcfc + 146
17  AppName                        0x0000000100e584df $S12AppName18HomeViewControllerC5coderACSgSo7NSCoderC_tcfcTo + 47
18  UIKitCore                           0x00000001088ec166 -[UIClassSwapper initWithCoder:] + 246
19  UIFoundation                        0x000000010c8f35ad UINibDecoderDecodeObjectForValue + 749
20  UIFoundation                        0x000000010c8f32b3 -[UINibDecoder decodeObjectForKey:] + 251
21  UIKitCore                           0x00000001088f07b8 -[UIRuntimeConnection initWithCoder:] + 178
22  UIFoundation                        0x000000010c8f35ad UINibDecoderDecodeObjectForValue + 749
23  UIFoundation                        0x000000010c8f3854 UINibDecoderDecodeObjectForValue + 1428
24  UIFoundation                        0x000000010c8f32b3 -[UINibDecoder decodeObjectForKey:] + 251
25  UIKitCore                           0x00000001088ee067 -[UINib instantiateWithOwner:options:] + 1220
26  UIKitCore                           0x0000000108e228b6 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 181
27  UIKitCore                           0x0000000108c8103a -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 112
28  UIKitCore                           0x0000000108c8150c -[UIApplication _loadMainInterfaceFile] + 272
29  UIKitCore                           0x0000000108c7fb25 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1357
30  UIKitCore                           0x000000010849e4e9 __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
31  UIKitCore                           0x00000001084a729c +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
32  UIKitCore                           0x000000010849e126 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 233
33  UIKitCore                           0x000000010849eae0 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 1085
34  UIKitCore                           0x000000010849ccb5 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 795
35  UIKitCore                           0x000000010849c95f -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 435
36  UIKitCore                           0x00000001084a1a90 __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 584
37  UIKitCore                           0x00000001084a280e _performActionsWithDelayForTransitionContext + 100
38  UIKitCore                           0x00000001084a17ef -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 221
39  UIKitCore                           0x00000001084a693a -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
40  UIKitCore                           0x0000000108c7e44e -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
41  UIKitCore                           0x0000000108822d09 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 357
42  FrontBoardServices                  0x000000010f55e2da -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 448
43  FrontBoardServices                  0x000000010f569443 __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 271
44  FrontBoardServices                  0x000000010f568b3a __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 53
45  libdispatch.dylib                   0x000000010548a602 _dispatch_client_callout + 8
46  libdispatch.dylib                   0x000000010548db78 _dispatch_block_invoke_direct + 301
47  FrontBoardServices                  0x000000010f59dba8 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 30
48  FrontBoardServices                  0x000000010f59d860 -[FBSSerialQueue _performNext] + 457
49  FrontBoardServices                  0x000000010f59de40 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
50  CoreFoundation                      0x0000000103630721 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
51  CoreFoundation                      0x000000010362ff93 __CFRunLoopDoSources0 + 243
52  CoreFoundation                      0x000000010362a63f __CFRunLoopRun + 1263
53  CoreFoundation                      0x0000000103629e11 CFRunLoopRunSpecific + 625
54  GraphicsServices                    0x000000010c5b71dd GSEventRunModal + 62
55  UIKitCore                           0x0000000108c8181d UIApplicationMain + 140
56  AppName                        0x0000000100e8e794 main + 68
57  libdyld.dylib                       0x0000000105500575 start + 1
)

我真的不知道它可能是什么。 嘗試在[UIViewController _loadViewFromNibNamed:bundle:]設置一個符號斷點,但這並沒有給出任何有用的見解。 希望有人能提供幫助。 我還要提到我在AppDelegate唯一要做的就是實例化firebase。

在reddit有用的家伙為我找到了它。 沒有意識到,但我的初始視圖控制器上有一個init()函數,最后一個人檢查了互聯網連接並重定向到另一個頁面,如果沒有。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM