Ios 无法在名为&x27;的捆绑包中加载NIB;5JK-D5-ZKP-view-1nz-4p-isc';

Ios 无法在名为&x27;的捆绑包中加载NIB;5JK-D5-ZKP-view-1nz-4p-isc';,ios,swift,uistoryboard,nsbundle,Ios,Swift,Uistoryboard,Nsbundle,我有一个故事板,它有2个视图控制器,包括UINavigationController本身。我在应用程序中做了一些更改,然后奇怪地出现了错误 *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/***/Library/Developer/CoreSimulator/De

我有一个故事板,它有2个视图控制器,包括UINavigationController本身。我在应用程序中做了一些更改,然后奇怪地出现了错误

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/***/Library/Developer/CoreSimulator/Devices/96021E81-BD05-4193-86ED-7F386739B99E/data/Containers/Bundle/Application/E684814B-7F84-41CE-B762-64C66A4AE4F8/***.app> (loaded)' with name '5JK-D5-ZKP-view-1nz-4p-isc''
***由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“无法在捆绑包中加载NIB:“NSBundle(loaded)”,名称为“5JK-D5-ZKP-view-1nz-4p-isc”

我尝试禁用大小类,但没有成功。我还深入研究了故事板XML,发现
5JK-D5-ZKP
是导航控制器中的
根视图控制器的序列,而
1nz-4p-isc
UITableViewController
中的表视图,这是根视图控制器。

问题的原因是
UITableViewController
子类及其方法
init(coder-aDecoder:NSCoder)
中存在自定义初始化。由于没有覆盖其他初始化方法,该覆盖大致类似于:

required init?(coder aDecoder: NSCoder) {
    //  Initialize fetcher
    fetcher = QuestionFetcher(delegate: self)

    //  Call the super.init method
    super.init(coder: aDecoder)

    //  Initialize the activity indicator for fetching questions
    activityIndicator = UIActivityIndicatorView(frame: CGRect(x: tableView.frame.size.width / 2.00, y: tableView.frame.size.height / 2.00, width: 20, height: 20))
    activityIndicator.hidesWhenStopped = true
    activityIndicator.hidden = true
}

棘手的是,在情节提要中找到的签名的读取器试图调用覆盖中找到的
init?(coder:NSCoder)
,但是正如您所看到的,它是一个。但该视图控制器没有从编码器加载,因此失败。

这可能是其他代码的结果。你应该考虑告诉我们在这之前发生了什么变化(在代码中)或者包括一个示例项目。我找到了原因,我现在就把它写下来。无论如何,谢谢你。