我在我的應用上使用自定義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 請幫我解決。非常感謝! –