nib 中的重用标识符与用于注册 nib 的标识符不匹配

Reuse identifier in nib does not match the identifier used to register the nib

我有一个用 Swift 编写的 Framework/Module,它提供了一些具有 IBDesignable 功能的自定义控件。

目前我正在开发基于 CollectionView 的控件。 CollectionView 和自定义 CollectionViewCell 是在 Nib 文件中构建的。要加载 CollectionViewNib 并添加可设计功能,我使用此 NibDesignable class。初始化 CollectionView 后,我按如下方式注册 CollectionViewCell:

let cellIdentifier = "collectionViewCell"

required public init?(coder aDecoder: NSCoder) {
    super.init(coder: aDecoder)
    self.setup()
}

override init(frame: CGRect) {
    super.init(frame: frame)
    self.setup()
}

private func setup() {
    let bundle = NSBundle(forClass: self.dynamicType)
    self.collectionView.registerNib(UINib(nibName: "CollectionViewCell", bundle: bundle), forCellWithReuseIdentifier: self.cellIdentifier)
}

将我的框架作为嵌入式二进制文件添加到另一个应用程序后,我可以按预期使用我的新自定义 CollectionView,但不幸的是,Designable 功能无法正常工作,而是收到以下错误消息:

IB Designables: Failed to update auto layout status: 
The agent raised a "NSInternalInconsistencyException" exception: 
view reuse identifier in nib (ibCollectionViewCell) does not match the identifier used to register the nib (collectionViewCell)

如上所述,我的控件在模拟器和我的 Phone 上工作,所以不,我不使用不同的标识符。我不知道 XCode 从哪里得到这个 ibCollectionViewCell 标识符,但是当我将它用作我的 CollectionViewCell 的标识符时,一切都非常有效。

知道这个标识符的来源以及为什么 XCode 不能用我自己的标识符加载我的自定义 CollectionViewCell 吗?

从 XCode 7 Beta 4 更新到 Beta 5 后,错误消失了。所以我假设以前的版本有一些错误