该应用程序在运行时运行良好iphone模拟器,但在ipad视网膜模拟器,我看到这个崩溃:
2015-04-15 18:39:13.814 [17308:2881892] *** 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“无法在捆绑包中加载NIB:“NSBundle .app>(已加载)”,名称为“ 7bK-jq-Zjz-view-r7i-6Z-zg0''
不知道发生了什么事。我没有带有这个奇怪名称的 nib/xib 文件:“7bK-jq-Zjz-view-r7i-6Z-zg0”
自从我尝试运行 ipad 模拟器以来已经有一段时间了。与此同时,发生了一些重大变化(我不确定是否导致了这个问题):
1. 项目更名
2.升级到Swift 1.2。它无助于将项目恢复到此更改之前,因为 Sift 已经是 1.2 版本了。
我该如何解决这个问题?
UPDATE
我查看了故事板源代码(按照 Kamal 的建议),发现“7bK-jq-Zjz”是表视图控制器的 ID(该控制器是选项卡栏控制器的第一个选项卡,而选项卡栏控制器又是主视图)分割视图控制器)。
奇怪代码的第二部分“r7i-6Z-zg0”原来是上述表视图控制器内表视图的 ID。
我尝试了两件事:
- 重新创建了分割视图控制器和选项卡栏控制器。在 ipad 模拟器上也出现同样的崩溃(iPhone 模拟器仍然运行良好)。
- 重新创建了麻烦的表视图控制器。仍然会看到相同的崩溃,但现在具有不同的代码/签名,因为 ID 现在是新的(对于新创建的表和表视图控制器)。
这是新的崩溃:
2015-04-17 22:10:01.427 [33373:6444860] *** 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“无法在捆绑包中加载NIB:“NSBundle .app>(已加载)”,名称为“ 3hh-RB-vwq-view-1d1-Kq-Vzm''
正如前面提到的,iPhone 模拟器运行良好,而 iPad 则不然。但 iPhone 6 plus 在转向横向模式时(即当分屏视图未折叠时)有时会崩溃。
-- 更新结束
*** First throw call stack:
(
0 CoreFoundation 0x0031f746 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x01f33a97 objc_exception_throw + 44
2 CoreFoundation 0x0031f66d +[NSException raise:format:] + 141
3 UIKit 0x0109fe2f -[UINib instantiateWithOwner:options:] + 1003
4 UIKit 0x00eba124 -[UIViewController _loadViewFromNibNamed:bundle:] + 270
5 UIKit 0x00eba8bb -[UIViewController loadView] + 295
6 UIKit 0x010c069e -[UITableViewController loadView] + 77
7 UIKit 0x00ebaaef -[UIViewController loadViewIfRequired] + 78
8 UIKit 0x00ebb095 -[UIViewController view] + 35
9 UIKit 0x00f0ad2f -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 426
10 UIKit 0x00f0a36f -[UITabBarController transitionFromViewController:toViewController:] + 64
11 UIKit 0x00f0652b -[UITabBarController _setSelectedViewController:] + 339
12 UIKit 0x00f062e5 -[UITabBarController setSelectedIndex:] + 115
13 UIKit 0x00f05e91 __51-[UITabBarController _setViewControllers:animated:]_block_invoke394 + 43
14 UIKit 0x00ddfd4f +[UIView(Animation) performWithoutAnimation:] + 82
15 UIKit 0x00f05d3d -[UITabBarController _setViewControllers:animated:] + 3627
16 UIKit 0x00f04403 -[UITabBarController _updateLayoutForTraitCollection:] + 302
17 UIKit 0x00f03e73 __80-[UITabBarController willTransitionToTraitCollection:withTransitionCoordinator:]_block_invoke + 69
18 UIKit 0x0125f107 -[_UIViewControllerNullAnimationTransitionCoordinator _applyBlocks:releaseBlocks:] + 198
19 UIKit 0x0125ed9a -[_UIViewControllerNullAnimationTransitionCoordinator _runAlongsideAnimations] + 148
20 UIKit 0x00ed8063 -[UIViewController(UIContainerViewControllerProtectedMethods) setOverrideTraitCollection:forChildViewController:] + 399
21 UIKit 0x01248a10 -[UISplitViewController _setMasterOverrideTraitCollectionActive:] + 127
22 UIKit 0x0124435a -[UISplitViewController initWithCoder:] + 112
23 UIKit 0x0122392e UINibDecoderDecodeObjectForValue + 739
24 UIKit 0x01223643 -[UINibDecoder decodeObjectForKey:] + 371
25 UIKit 0x010a0c1a -[UIRuntimeConnection initWithCoder:] + 189
26 UIKit 0x0122392e UINibDecoderDecodeObjectForValue + 739
27 UIKit 0x01223b30 UINibDecoderDecodeObjectForValue + 1253
28 UIKit 0x01223643 -[UINibDecoder decodeObjectForKey:] + 371
29 UIKit 0x0109fed0 -[UINib instantiateWithOwner:options:] + 1164
30 UIKit 0x0135d185 -[UIStoryboard instantiateViewControllerWithIdentifier:] + 220
31 UIKit 0x0135d301 -[UIStoryboard instantiateInitialViewController] + 74
32 UIKit 0x00d556fc -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 79
33 UIKit 0x00d55984 -[UIApplication _loadMainInterfaceFile] + 245
34 UIKit 0x00d542f4 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1337
35 UIKit 0x00d6d93e __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke + 59
36 UIKit 0x00d5304a -[UIApplication workspaceDidEndTransaction:] + 155
37 FrontBoardServices 0x0451ec9e __37-[FBSWorkspace clientEndTransaction:]_block_invoke_2 + 71
38 FrontBoardServices 0x0451e72f __40-[FBSWorkspace _performDelegateCallOut:]_block_invoke + 54
39 FrontBoardServices 0x04530d7c __31-[FBSSerialQueue performAsync:]_block_invoke_2 + 30
40 CoreFoundation 0x00241050 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
41 CoreFoundation 0x00236963 __CFRunLoopDoBlocks + 195
42 CoreFoundation 0x002367bb __CFRunLoopRun + 2715
43 CoreFoundation 0x00235a5b CFRunLoopRunSpecific + 443
44 CoreFoundation 0x0023588b CFRunLoopRunInMode + 123
45 UIKit 0x00d52a02 -[UIApplication _run] + 571
46 UIKit 0x00d56106 UIApplicationMain + 1526
47 IDZZZ 0x000a3ad4 main + 180
48 libdyld.dylib 0x02644ac9 start + 1