iOS - 无法在包NSInternalInconsistencyException中加载NIB

时间:2012-10-17 11:08:43

标签: iphone objective-c ios xcode cocoa-touch

无法解决此问题

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/A0EC53C5-E9C0-4191-9BAF-0B61205B92F0/Handbook.app> (loaded)' with name 'pAM-c5-AKQ-view-CuA-a0-uZt' and directory 'Storyboard.storyboardc''

我有ListViewController: UITableViewController推送另一个DetailViewController

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self performSegueWithIdentifier:@"ShowDetailsSegue" sender:self];
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([[segue identifier] isEqualToString:@"ShowDetailsSegue"])
    {
        DetailViewController *detailController = (DetailViewController *)[segue destinationViewController];

        detailController.department = [departmentsList objectAtIndex:[self.tableView indexPathForSelectedRow].row];
    }
}

奇怪的是我可以执行segue并返回5次。第5次我的DetailViewController出现空表,第6次出现上述异常。

我在SO上发现了很多类似的问题,但对我来说没有可行的解决方案。

不知道可能出现什么问题?有什么建议吗?

1 个答案:

答案 0 :(得分:0)

在导航控制器上返回时,我添加了类似的奇怪问题。我的情况是键盘问题。

对我来说,事实证明我的详细视图控制器正在被重用。我认为这是Xcode 4.5或iOS 6中的一项新功能,试图将笔尖负载的数量保持在较低水平。在-viewWillDisappear: / -viewDidDisappear:中我没有正确地清理自己。键盘认为它仍在显示,但不是。

我不知道你是否遇到类似问题,但可能值得研究。检查并查看每个负载是否获得相同的详细视图控制器对象。如果是这样,那么请查看您是否将详细视图控制器置于错误状态。