UICollectionViewData中的断言失败layoutAttributesForSupplementaryElementOfKind:atIndexPath

时间:2018-04-06 09:41:28

标签: swift uicollectionview

collectionView.dequeueReusableSupplementaryView(ofKind: kind, withReuseIdentifier: "ResultHeaderView", for: indexPath) as! ResultHeaderView

此行正在崩溃

"Assertion failure in -[UICollectionViewData layoutAttributesForSupplementaryElementOfKind:atIndexPath:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3600.9.1/UICollectionViewData.m:994
     *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'no UICollectionViewLayoutAttributes instance for -
    layoutAttributesForSupplementaryElementOfKind: UICollectionElementKindSectionHeader at path <NSIndexPath: 0x174820f20> {length = 2, path = 0 - 0}'"

0 个答案:

没有答案