我正在尝试加载一个笔尖,但一直收到以下错误:
-[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
}
感谢
好的,
这是因为未在NSCollectionViewItem对象上设置NibName和NibBundle。