我在我的应用上使用自定义UICollectionView
。但是,我有一个问题,使我的应用程序崩溃。在日志中崩溃:
注意:此错误不会在iOS 8UICollectionView收到ios中的单元格的布局属性7
2015-05-29 11:49:26.316 app9to5[1834:607] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView recieved layout attributes for a cell with an index path that does not exist: <NSIndexPath: 0x7fca0e00> {length = 2, path
= 0 - 14}'
> First throw call stack: (
CoreFoundation 0x039b61e4 __exceptionPreprocess + 180
libobjc.A.dylib 0x036808e5 objc_exception_throw + 44
CoreFoundation 0x039b6048 +[NSException raise:format:arguments:] + 136
Foundation 0x016954de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
UIKit 0x02be0866 __45-[UICollectionViewData validateLayoutInRect:]_block_invoke + 1793
UIKit 0x02bdfaed -[UICollectionViewData validateLayoutInRect:] + 1376
UIKit 0x02ba5603 -[UICollectionView layoutSubviews] + 173
UIKit 0x025c8964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
libobjc.A.dylib
请帮我解决。非常感谢!
你可以给我一些你的代码,尤其是在你的布局属性设置功能,您的CollectionView委托? –
@EugeneNguyen:您可以在链接https://gist.github.com/cuong-nguyen-ta/5b7f73f2fb9a316ffcf5查看此代码 我认为发生在我打电话时 '[self.collectionView reloadData];' –
@EugeneNguyen这是功能设置布局属性 https://gist.github.com/cuong-nguyen-ta/22f6d7c5039d3743a4f1 请帮我解决。非常感谢! –