设为首页 加入收藏

TOP

跳转UICollectionViewController报Could not load NIB in bundle解决办法
2017-10-12 12:07:35 】 浏览:608
Tags:跳转 UICollectionViewController Could not load NIB bundle 解决 办法

      报错代码如下:'Could not load NIB in bundle: 'NSBundle </Users/mac/Library/Developer/CoreSimulator/Devices/A0182119-C6AC-4732-BF37-3E6D35B102E1/data/Containers/Bundle/Application/E5F586ED-526F-4D52-9C7C-9335E772F666/00-ItcastLottery.app> (loaded)' with name 'product''

      项目中collectionViewController的自定义cell由xib创建。无奈每次运行都报这个错,大意是加载不了名字叫“product”的xib文件。网上搜到的办法试过都不行。直到第二晚排查才发现原因太简单,但很容易忽略,如果你不知道,以后可能会在这里摔跟头。

      static NSString * const reuseIdentifier = @"product"; 这行是在UICollectionViewController.m文件用来设定identifier的代码。问题就在“product”字符串这。想不出错,identifier字符串必须和UICollectionViewController控制器加载的自定义cell文件的文件名一样。

      MJ课程视频里并没讲这点注意事项,自学的童鞋按照以上办法解决。

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇IOS封装核心 下一篇iOS 微信分享

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目