无法加载NIB iOs

时间:2015-02-21 16:05:13

标签: ios storyboard

如果我在真实设备中构建我的应用程序,那就是控制台中显示的错误

2015-02-21 16:56:50.997 HiStatus [164:60b] NSMainNibFile和UIMainStoryboardFile都已设置。 NSMainNibFile被忽略。

2015-02-21 16:56:53.064 HiStatus[164:60b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/2C26B1F0-B064-49DF-85E3-AEEE404E8A38/Example.app> (loaded)' with name 'zx4-Jk-sTp-view-OsP-Nr-lO4' and directory 'Main.storyboardc''
*** First throw call stack:
(0x307bcfd3 0x3b035ccf 0x307bcf15 0x33347d75 0x332a062b 0x330fcbed 0x32fdd30d 0x32fdd289 0x33086937 0x330c34b3 0x330c1deb 0x330c0e55 0x13ec8c 0x13ed4c 0x3119c163 0x307881b7 0x30787dcf 0x3078616b 0x306f0f0f 0x306f0cf3 0x35649663 0x3303c16d 0x13b7bc 0x13b8d8 0x3b542ab7)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

重新启动Xcode后,它会向控制台添加错误:

2015-02-21 17:11:51.839 HiStatus[183:60b] NSMainNibFile and UIMainStoryboardFile are both set. NSMainNibFile ignored.

/private/var/mobile/Applications/5C841D54-3A68-40F7-BA87-32CBE8EDAF78/Library/Caches/Federico-Malagoni.HiStatus/Cache.db-wal: Too many open files
/private/var/mobile/Applications/5C841D54-3A68-40F7-BA87-32CBE8EDAF78/Library/Caches//Cache.db-journal: Too many open files
/private/var/mobile/Applications/5C841D54-3A68-40F7-BA87-32CBE8EDAF78/Library/Caches//Cache.db-shm: Too many open files
2015-02-21 17:11:53.866 HiStatus[183:60b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </var/mobile/Applications/5C841D54-3A68-40F7-BA87-32CBE8EDAF78/HiStatus.app> (loaded)' with name 'zx4-Jk-sTp-view-OsP-Nr-lO4' and directory 'Main.storyboardc''
*** First throw call stack:
(0x307bcfd3 0x3b035ccf 0x307bcf15 0x33347d75 0x332a062b 0x330fcbed 0x32fdd30d 0x32fdd289 0x33086937 0x330c34b3 0x330c1deb 0x330c0e55 0x16dc8c 0x16dd4c 0x3119c163 0x307881b7 0x30787dcf 0x3078616b 0x306f0f0f 0x306f0cf3 0x35649663 0x3303c16d 0x16a7bc 0x16a8d8 0x3b542ab7)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

信息 enter image description here 的Info.plist enter image description here

编辑2之后是错误:

2015-02-21 17:33:07.820 HiStatus[196:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'There doesn't seem to be a valid compiled storyboard at path '/var/mobile/Applications/10C6A1F4-BAE9-4317-8CEA-CB419235A62C/HiStatus.app/Main.storyboardc''
*** First throw call stack:
(0x307bcfd3 0x3b035ccf 0x334aaa71 0x18545c 0x180880 0x180d4c 0x3119c163 0x307881b7 0x30787dcf 0x3078616b 0x306f0f0f 0x306f0cf3 0x35649663 0x3303c16d 0x17d7bc 0x17d8d8 0x3b542ab7)
libc++abi.dylib: terminating with uncaught exception of type NSException

2 个答案:

答案 0 :(得分:0)

您是否尝试在项目上执行Clean并从设备中删除应用程序?

  1. 从您的设备删除应用
  2. 执行Clean(默认为Cmd + Shift + K
  3. 重新安装

答案 1 :(得分:0)

某些代码或屏幕截图会有所帮助,但请确保您没有拼写错误。也许您重命名了一些现在标记为红色的文件?

修改: 你的小伙子看起来很伤心。您应该删除条目“主Nib文件...”,因为您已经在那里指定了一个主故事板。

错误消息中的名称也很奇怪:zx4-Jk-sTp-view-OsP-Nr-lO4

也许您的项目设置截图和代码如何尝试加载笔尖可以解决难题。

编辑2 好的,请尝试以下步骤:

  • 在磁盘上找到LauncScreen.xib
  • 从项目中删除红色的LaunchScreen.xib,然后将该文件重新添加到项目中
  • 目标 - &gt;构建阶段确保将所有.xib文件添加到复制包资源(如果不添加它们)
  • 从.plist
  • 中删除“主Nib文件...”