我正在创建框架,因为我有 xib、图像等。在框架工作中,我正在创建名为 SampleTableviewCell.xib
的自定义 tableViewCell
。当此文件构建到 Bundle 中时,xib 文件的名称将转换为 SampleTableviewCell~iphone.nib
。因此,我在 cellForRowAtIndexPath
中加载此 xib 文件时遇到崩溃。
SampleTableviewCell *cell = (SampleTableviewCell *)[tableView dequeueReusableCellWithIdentifier:@"SampleTableviewCell"];
我的崩溃是,
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle </Users/myname/Library/Developer/CoreSimulator/Devices/ACEB5838-EC42-416F-95AA-4CE5932D5849/data/Containers/Bundle/Application/B20C8F8B-5E09-4D84-960C-614185E955DE/myapp.app/MySDK.bundle> (not yet loaded)' with name 'SampleTableviewCell''
我不知道为什么会这样。任何人都请帮我解决这个问题。实际上我不想捆绑 ~iphone。 谢谢。
最佳答案
经过长时间的努力,我找到了解决方案,
在我的 xcode 7 beta 4 中,将 bundle 的部署目标从 6.0 更改为 8.0
这是为了防止我创建用 ~iphone 修复的 nib 文件。
关于ios - .xib 文件名在创建包时更改为 ~iphone.nib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32202345/