ios - .xib 文件名在创建包时更改为 ~iphone.nib

标签 ios objective-c iphone

我正在创建框架,因为我有 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/

相关文章:

iOS 应用程序崩溃 - dyld : Library not loaded: @rpath/GTMSessionFetcher. 框架/GTMSessionFetcher

iphone - 如何检查它是从哪个 View Controller 导航的....在obj c中

android - react 导航 : how to detect if a screen is inside a TabNavigator or a DrawerNavigator?

ios - NSHTTPCookie:expiresDate 始终为空

javascript - 使用包含 .js 和 .css 文件的嵌入式 URL 加载 webview

ios - navigationBar backButton 标题存在,但在实例化的 viewController 上缺少箭头

iphone - 如何在 init 方法中更改 nib uiimageview 图像?

ios - 如何在每个显示文本的触摸按钮后打印空格

ios - UIScrollView 从底 View 开始

iphone - OpenCV 检测 iphone 方向