我正在尝试加载一个笔尖,但不断收到以下错误:
-[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
}
由于
答案 0 :(得分:1)
确定,
这是因为没有在NSCollectionViewItem对象上设置NibName和NibBundle。