终止app:无法在bundle中加载NIB:'NSBundle ...',名称为'7bK-jq-Zjz-view-r7i-6Z-zg0' [英] Terminating app: Could not load NIB in bundle: 'NSBundle ...' with name '7bK-jq-Zjz-view-r7i-6Z-zg0'

查看:162
本文介绍了终止app:无法在bundle中加载NIB:'NSBundle ...',名称为'7bK-jq-Zjz-view-r7i-6Z-zg0'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iphone 模拟器中运行该应用程序运行正常,但在 ipad 视网膜模拟器中运行它,我看到此崩溃:

The app runs fine when run on in the iphone simulator, but running it in the ipad retina simulator, I see this crash:

2015-04-15 18:39:13.814 [17308:2881892] ***由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'无法在bundle中加载NIB:'NSBundle .app >(已加载)'名称为'7bK-jq-Zjz-view-r7i-6Z-zg0''

2015-04-15 18:39:13.814 [17308:2881892] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle .app> (loaded)' with name '7bK-jq-Zjz-view-r7i-6Z-zg0''

不确定发生了什么。我没有这个奇怪名字的nib / xib文件:'7bK-jq-Zjz-view-r7i-6Z-zg0'

Not sure what is going on. I do not have nib/xib files with this weird name: '7bK-jq-Zjz-view-r7i-6Z-zg0'

我已经有一段时间了试过运行ipad模拟器。我与此同时发生了一些重大变化(我不确定是否会导致这个问题):
1.重命名项目
2.升级到Swift 1.2。由于Sift已经在1.2上,因此无法将项目恢复到此更改之前。

It has been some time since I tried running the ipad simulator. I the meantime some big changes took place (which I am not sure if it resulted in this issue): 1. Renamed the project 2. Upgraded to Swift 1.2 . It does not help reverting the project to before this change, since Sift is already on 1.2.

我将如何进行故障排除?

How would I go about troubleshooting it?

我查看了故事板源(根据Kamal的建议),发现'7bK-jq-Zjz'是一个ID表视图控制器(此控制器是选项卡栏控制器的第一个选项卡,它又是拆分视图控制器的主视图)。

I looked in the storyboard source (as per Kamal's suggestion) and found that '7bK-jq-Zjz' was the ID of a table view controller (this controller is the first tab of a tab bar controller, which in turn is the master view of a split view controller).

第二部分奇怪的代码'r7i-6Z-zg0',原来是提到的表视图控制器中的表视图的ID。

The second part of the weird code, 'r7i-6Z-zg0', turned out to be the ID of the table view inside the mentioned table view controller.

我尝试了两件事:


  1. 重新创建拆分视图控制器和标签栏控制器。与ipad模拟器相同的崩溃(仍然是iphone模拟器正常运行)。

  2. 重新创建了麻烦的表视图控制器。仍然看到相同的崩溃,现在使用不同的代码/签名,因为ID现在是新的(对于新创建的表和表视图控制器)。

以下是新的崩溃:

2015-04-17 22:10:01.427 [33373:6444860] ***因未捕获的异常而终止应用'NSInternalInconsistencyException ',原因:'无法在捆绑中加载NIB:'NSBundle .app>(已加载)',名称为'3hh-RB-vwq-view-1d1-Kq-Vzm''

2015-04-17 22:10:01.427 [33373:6444860] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle .app> (loaded)' with name '3hh-RB-vwq-view-1d1-Kq-Vzm''

如上所述,iPhone模拟器运行良好 - iPad没有。但是当定向到横向模式时(即拆分视图没有折叠时),iPhone 6 plus有时会崩溃。

As mentioned iPhone simulators run fine - iPads not. But the iPhone 6 plus sometimes crashes when orientating to landscape mode (i.e. when the split view is not collapsed).

- 结束更新

*** 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


推荐答案

我从iOS 8.3开始就遇到了这个问题,最后解决了它。我曾希望这个问题能在iOS 8.4中得到解决,但事实并非如此,我认为这不是一个错误。

I had this issue starting with iOS 8.3 and finally solved it yesterday. I had hoped the issue would be fixed in iOS 8.4 but it isn't so I'm assuming it isn't considered a bug.

我有一个带有2的UISplitViewController UINavigationControllers作为主/详细视图。主视图UINavigationController有一个UITabBarController。当这个失败时,有3个UITableViewControllers作为UITabBarController的子视图。错误正是你所拥有的:iOS 8.3+在尝试加载标签栏的第一个子视图时抛出错误,即使nib肯定存在于故事板中并且在iPhone上正常工作。

I have a UISplitViewController with 2 UINavigationControllers as the master/detail views. The master view UINavigationController has a UITabBarController. When this was failing, there were 3 UITableViewControllers as the child views for the UITabBarController. The error was exactly what you have: iOS 8.3+ throws an error trying to load the first child view of the tab bar even though the "nib" is definitely there in the storyboard and works fine on iPhone.

我的修复是在UITabBarController和每个UITableViewController子视图之间插入一个UINavigationController。因此,UITabBarController与3个UITavViewControllers的视图控制器关系代替UITabBarController,现在具有与3个UINavigationControllers的视图控制器关系,并且每个UINavigationControl与其中一个UITableViewControllers具有根视图控制器关系。

The fix for me was to insert a UINavigationController between the UITabBarController and each of the UITableViewController child views. So instead of UITabBarController with "view controller" relationships to 3 UITableViewControllers, the UITabBarController now has "view controllers" relationships to 3 UINavigationControllers and each of those UINavigationControllers have "root view controller" relationships to one of the UITableViewControllers.

这可能为时已晚,但我希望它有所帮助。

This may be too late but I hope it helps someone.

这篇关于终止app:无法在bundle中加载NIB:'NSBundle ...',名称为'7bK-jq-Zjz-view-r7i-6Z-zg0'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆