【问题标题】:"" bundle because the bundle has not been loaded - Empty bundle name"" 捆绑包,因为捆绑包尚未加载 - 捆绑包名称为空
【发布时间】:2016-05-13 16:52:38
【问题描述】:

我正在尝试加载笔尖,但不断收到以下错误:

-[NSViewController initWithCoder:] could not instantiate an NSViewController for a nib in the "" bundle because the bundle has not been loaded.

缺少捆绑包名称...是什么原因造成的?

func collectionView(collectionView: NSCollectionView, itemForRepresentedObjectAtIndexPath indexPath: NSIndexPath) -> NSCollectionViewItem
{

    let item = collectionView.makeItemWithIdentifier("MyNib", forIndexPath: indexPath) // Crashes here

}

谢谢

【问题讨论】:

  • 显示你用来实例化 NSViewController 的代码...
  • 添加了代码,这是很标准的东西。

标签: cocoa nsviewcontroller


【解决方案1】:

好的,

这是因为 NibName 和 NibBundle 没有在 NSCollectionViewItem 对象上设置。

【讨论】:

  • 我在这个问题上花了几个小时,但由于您的回答,现在解决了!
  • Nib Bundle Identifier 应该是什么?
猜你喜欢
  • 2012-03-28
  • 1970-01-01
  • 2012-06-29
  • 1970-01-01
  • 1970-01-01
  • 2012-06-21
  • 1970-01-01
  • 2016-01-26
  • 2017-12-21
相关资源
最近更新 更多