2016-05-13 18 views
1

我試圖加載筆尖,而是不斷收到以下錯誤:「」包,因爲包尚未加載 - 空包名稱

-[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

顯示您用於實例化NSViewController的代碼... –

+0

添加了代碼,這是相當標準的東西。 – Chris

回答

1

好吧,

這是因爲NibName和NibBundle未在該NSCollectionViewItem對象上設置。

+0

我在這個問題上花了幾個小時,但現在解決了感謝您的答案! –

相關問題