[英]My app works well on iPad simulator but crashed on iPad(iOS 8.4) ,the xcode says Could not load NIB in bundle
Here is the full message i got: 这是我收到的完整消息:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </private/var/mobile/Containers/Bundle/Application/EA93D8D1-339F-4007-A5AA-671461179671/******.app> (loaded)' with name 'a0J-YD-TZi-view-qwI-Ja-FwJ''
I had searched a lot of answers about 'Could not load NIB in bundle',my condition seems different from these,i have never used a nib named a0J-YD-TZi-view-qwI-Ja-FwJ in my project. 我搜索了很多有关“无法将NIB装入捆绑包”的答案,我的情况似乎与此不同,我从未在项目中使用过名为a0J-YD-TZi-view-qwI-Ja-FwJ的笔尖。 there are two storyboard in my project(Main_iPad,Main_iPhone), and the app works well on iPhone and iPhone simulator.
我的项目中有两个情节提要板(Main_iPad,Main_iPhone),该应用程序在iPhone和iPhone模拟器上运行良好。 any help will be appreciate!
任何帮助将不胜感激!
Try resetting the Simulator and also cleaning your build folder. 尝试重置模拟器,并清理构建文件夹。
Another problem could be that the nib is part of the bundle resources that are copied to the app during building. 另一个问题可能是,笔尖是捆绑资源的一部分,捆绑资源在构建期间会复制到应用程序。 Can you check if the file is included in the Copy Bundle Resources build phase?
您可以检查文件是否包含在“副本捆绑资源”构建阶段中吗?
Might be this is happening due to iOS is case sensitive, simulator is not. 可能由于iOS区分大小写而不是模拟器而导致发生这种情况。 Make sure you use the correct file names, .
确保使用正确的文件名。 so if it works in simulator but not on device check the cases on the file name.
因此,如果它可以在模拟器中运行但不能在设备上运行,请检查文件名中的大小写。
Another thing is when you add a new file to the project xcode will automatically add it to the "Copy Bundle resources" section of your target. 另一件事是,当您将新文件添加到项目xcode时,它将自动将其添加到目标的“复制捆绑包资源”部分。
Sometimes, if you are collaborating with another person the project.pbxproj will get out of sync and this entry will get removed. 有时,如果您正在与其他人协作,则project.pbxproj将不同步,并且该条目将被删除。 The fix is to ensure that all the files in the Resources folder (that are required in the release) are also present in the "Copy Bundle resources" section, and if it isn't just drag it from the resources to that section.
该修补程序是为了确保“复制捆绑资源”部分中还存在“资源”文件夹中的所有文件(版本中必需的),如果不是,则仅将其从资源拖到该部分中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.