Objective c 带有CSStickyHeaderFlowLayout的UICollectionView在上下滚动时崩溃

Objective c 带有CSStickyHeaderFlowLayout的UICollectionView在上下滚动时崩溃,objective-c,uicollectionview,ios9,xcode8.1,Objective C,Uicollectionview,Ios9,Xcode8.1,我使用CSStickyHeaderFlowLayout创建了一个UICollectionView,因为我想为UICollectionView及其部分创建单独的标题。它成功地显示了数据,但当我向上或向下滚动时,当它触及顶部或底部边界时,它就会崩溃,出现以下错误,我只是希望集合视图及其部分有单独的标题,就像我们在UITableView中看到的一样。如果有人可以帮助解决这个问题,或者指出一些替代方案 2016-12-06 11:50:51.881 TestStickyHeader[899:18365]

我使用CSStickyHeaderFlowLayout创建了一个UICollectionView,因为我想为UICollectionView及其部分创建单独的标题。它成功地显示了数据,但当我向上或向下滚动时,当它触及顶部或底部边界时,它就会崩溃,出现以下错误,我只是希望集合视图及其部分有单独的标题,就像我们在UITableView中看到的一样。如果有人可以帮助解决这个问题,或者指出一些替代方案

2016-12-06 11:50:51.881 TestStickyHeader[899:18365]*在[UICollectionViewData validateLayoutInRect:]、/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3600.5.2/UICollectionViewData.m:445中断言失败 2016-12-06 11:50:51.929 TestStickyHeader[899:18365]*由于未捕获的异常“NSInternalInconsistencyException”终止应用程序,原因:“索引路径({length=2,path=9-0})处补充项的布局属性从Indexath:{9,0}zIndex:1024有效:是种类:UICollectionElementKindSectionHeader更改为Indexath:{9,0}zIndex:1024 valid:YES kind:UICollectionElementKindSectionHeader不使布局的 ***第一次抛出调用堆栈: ( 0 CoreFoundation 0x0000000104cbb34b异常预处理+171 1 libobjc.A.dylib 0x000000010471c21e objc_异常_抛出+48 2 CoreFoundation 0x0000000104cbf442+[N异常提升:格式:参数:][98 3基金会0x000 000 01042B2E4D- [ NSRealStutsHuffer-HuffLeuluIn方法:对象:文件:文件号:描述:] + 195 4 UIKit 0x00000001063f5c3b\uuuu 45-[UICollectionViewData validateLayoutInRect:][uBlock\uInvoke+1436 5 UIKit 0x00000001063f5093-[UICollectionViewData validateLayoutInRect:+2984 6 UIKit 0x00000001063f835e-[UICollectionViewData LayoutAttributesForcellsRect:validateLayout:+170 7 UIKit 0x0000000106392909-[UICollectionView\u computePrefetchCandidatesForVisibleBounds:futureVisibleBounds:prefetchVector:notifyDelegateIfNeeded:+134 8 UIKit 0x0000000106392877-[UICollectionView_computePrefetchCandidatesForVelocity:notifyDelegateIfNeeded:+214 9 UIKit 0x000000010639278d-[UICollectionView\u预取项服务:maxItemsToPrefetch:invalidateCandidatesOnDirectionChanges:+934 10 UIKit 0x000000010639baa7-[UICollectionView布局子视图]+717 11 UIKit 0x0000000105b12f50-[UIView(CALayerDelegate)布局层的子层:+1237 12夸脱芯0x00000001058c5cc4-[CALayer layoutSublayers]+146 13夸脱核心0x00000001058b9788 _Zn2Ca5层布局_如果需要PNS 11交易+366 14个QuartzCore 0x00000001058b9606 _ZN2CA58层布局和显示(如果需要)PNS 11事务+24 15 QuartzCore 0x0000000105847680_ZN2CA7Context18提交交易PNS_11交易+280 16夸脱矿0x0000000105874767_Zn2Ca11交易承诺+475 17夸脱核心0x00000001057cfb97_ZN2CA7Display11显示链接14调度_项目Y+611 18 CoreFoundation 0x0000000104c4d964运行循环正在调用计时器回调函数 19 CoreFoundation 0x0000000104c4d5f3__CFRunLoopDoTimer+1075 20 CoreFoundation 0x0000000104c4d17a\uu CFRunLoopDoTimers+250 21 CoreFoundation 0x0000000104c44f01__CFRunLoopRun+2065 22 CoreFoundation 0x0000000104c44494 CFRunLoopRunSpecific+420 23图形服务0x0000000109e38a6f GSEventRunModal+161 24 UIKit 0x0000000105a4e964 UIApplicationMain+159 25 TestStickyHeader 0x0000000103d9411f干管+111 26 libdyld.dylib 0x000000010b44c68d启动+1 27°?0x0000000000000001 0x0+1 ) libc++abi.dylib:以NSException类型的未捕获异常终止