尝试在我的设备上运行我的应用程序时出现以下 SIGART 错误:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'ViewController''
我的 iOS 经验和知识非常有限,但我认为这可能与我的 ViewController.m 中的以下代码片段有关
-(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
if((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]))
{
log = [[NSMutableString alloc] init];
}
return self;
}
有人知道为什么会这样吗?
最佳答案
为了解决这个问题,我做了以下事情:
- 打开 XCode 目标
- 转到“构建阶段”选项卡
- 点击“复制捆绑资源”部分
- 点击添加按钮
- 添加丢失的 Nib 文件
或者这个问题也是关于 Nib 名称的。检查 nib 名称拼写,正确,区分大小写。
关于ios - 由于未捕获的异常 'NSInternalInconsistencyException' 而终止应用程序,原因 : 'Could not load NIB in bundle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19025487/