【问题标题】:Unable to load item prototype in NSCollectionView无法在 NSCollectionView 中加载项目原型
【发布时间】:2015-07-16 22:07:58
【问题描述】:

在我的 Swift 应用程序中执行 self.colSoundEffects.itemPrototype = self.storyboard!.instantiateControllerWithIdentifier("SoundEffect_Item") as? NSCollectionViewItem 时,我收到以下错误消息,并且我的视图没有加载:

2015-07-16 15:01:21.790 SoundBoardFX[48244:19680526] -[NSIBObjectData initWithCoder:]: corrupt and unarchivable nib file
2015-07-16 15:01:21.791 SoundBoardFX[48244:19680526] *** Assertion failure in -[NSStoryboard instantiateControllerWithIdentifier:], /SourceCache/AppKit/AppKit-1348.17/AppKit.subproj/Storyboarding/NSStoryboard.m:208
2015-07-16 15:01:21.791 SoundBoardFX[48244:19680526] Failed to set (contentViewController) user defined inspected property on (NSWindow): Could not load the scene view controller for identifier 'SoundEffect_Item'

我已经仔细检查了所有标识符,据我所知,一切正常。当我删除该行时,我的视图加载没有问题(当然,没有项目原型)。

为什么会发生这种情况,我该如何解决?

我正在运行 OS X 10.10.4、Xcode 6.4 (6E35b)。

【问题讨论】:

  • 我也遇到了同样的问题,你找到解决办法了吗?

标签: macos swift prototype nscollectionview


【解决方案1】:

您是否尝试使用“SoundEffect_Item”视图控制器创建新的故事板?您可以将其复制并粘贴到新故事中,以查看之前的故事是否已损坏。

【讨论】:

  • 是的,我做到了,我得到了完全相同的错误。我什至尝试创建一个全新的项目,但没有帮助。
  • 我会检查 self.storyboard 以查看它是否指向正确的对象。以及是否在 IB 中正确设置 contentViewController
猜你喜欢
  • 1970-01-01
  • 2023-03-23
  • 2011-12-23
  • 2019-01-03
  • 1970-01-01
  • 2022-07-09
  • 2017-09-07
  • 1970-01-01
  • 2012-12-08
相关资源
最近更新 更多