无法在名称为“5JK-D5-ZKP-view-1nz-4p-isc”的捆绑包中加载 NIB
Could not load NIB in bundle with name: '5JK-D5-ZKP-view-1nz-4p-isc'
我有一个故事板,它有 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''
我尝试禁用 大小 类,但没有用。我还深入研究了故事板 XML,发现 5JK-D5-ZKP
是导航控制器中 root view controller
的续集,1nz-4p-isc
是内部的 table 视图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
}
棘手的是,在情节提要中找到的签名 reader 试图调用覆盖中找到的 init?(coder: NSCoder)
,但是如您所见,它是 failable initializer。但是那个视图控制器不是从编码器加载的,所以它失败了。
我有一个故事板,它有 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''
我尝试禁用 大小 类,但没有用。我还深入研究了故事板 XML,发现 5JK-D5-ZKP
是导航控制器中 root view controller
的续集,1nz-4p-isc
是内部的 table 视图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
}
棘手的是,在情节提要中找到的签名 reader 试图调用覆盖中找到的 init?(coder: NSCoder)
,但是如您所见,它是 failable initializer。但是那个视图控制器不是从编码器加载的,所以它失败了。