Chris
Chris

Reputation: 2907

"" bundle because the bundle has not been loaded - Empty bundle name

I'm trying to load a nib, but keep getting the following error:

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

The bundle name is missing...what would cause that?

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

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

}

Thanks

Upvotes: 1

Views: 158

Answers (1)

Chris
Chris

Reputation: 2907

Ok,

It was because the NibName and NibBundle were not set on the NSCollectionViewItem object.

Upvotes: 1

Related Questions