本文介绍了由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'无法在bundle中加载NIB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在我的设备上运行我的应用程序,运行时出现以下SIGART错误:

Trying to run my app on my device and I've got the following SIGART error when I run it:

我的iOS经验和知识非常有限但我认为它可能与我的ViewController.m中的以下代码片段有关

I have very limited iOS experience and knowledge but I think it may be relating to the following code snippet in my ViewController.m

-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    if((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]))
    {
        log = [[NSMutableString alloc] init];
    }

    return self;
}

有谁知道为什么会这样?

Does anyone know why this is happening?

推荐答案

为了解决这个问题,我做了以下几点:

To fix the problem, I did the following:


  1. 打开XCode目标

  2. 转到构建阶段选项卡

  3. 单击复制捆绑资源部分

  4. 点击添加按钮

  5. 添加缺少的Nib文件

  1. Open XCode Target
  2. Go to the "Build phases" tab
  3. Click the "Copy bundle resources" section
  4. Click the add button
  5. Add the missing Nib file

或者这个问题也是关于笔尖名称。检查笔尖名称拼写,它是正确的,区分大小写。

Or This issue is also regarding the nib name. Check the nib name spelling, it's correct, case sensitive.

这篇关于由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'无法在bundle中加载NIB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 13:36