gpt4 book ai didi

cocoa - "" bundle ,因为该 bundle 尚未加载 - bundle 名称为空

转载 作者:行者123 更新时间:2023-12-03 17:10:00 27 4
gpt4 key购买 nike

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

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

bundle 名称丢失...会导致什么情况?

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

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

}

谢谢

最佳答案

好的,

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

关于cocoa - "" bundle ,因为该 bundle 尚未加载 - bundle 名称为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37215462/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com