iOS 9:未设置UICollectionView dataSource

del*_*rox 7 ios uicollectionview ios9

自iOS 9推出以来,NSInternalInconsistencyException:即使设置了数据源,crashalytics也报告了相当多的崩溃事件.感觉它可能是一个SDK错误,但我不知道如何避免它.

细节:

  • 这只发生在iOS 9上.在iOS 9上发生了数百次,在7/8上发生了零次
  • 这发生在UIKit代码深处的主线程上
  • 我正在设置dataSource,但看起来UICollectionView比数据源寿命长?
  • 没有一致的复制品,但根据crashalytics,它每天都会发生多次.
Thread : Fatal Exception: NSInternalInconsistencyException
0  CoreFoundation                 0x181a91900 __exceptionPreprocess
1  libobjc.A.dylib                0x1810fff80 objc_exception_throw
2  CoreFoundation                 0x181a917d0 +[NSException raise:format:]
3  Foundation                     0x18240499c -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:]
4  UIKit                          0x1869152dc -[UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:withLayoutAttributes:applyAttributes:]
5  UIKit                          0x1867e8990 -[UICollectionView _updateVisibleCellsNow:]
6  UIKit                          0x1867e389c -[UICollectionView layoutSubviews]