Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NSInternalInconsistencyException - UICollectionView received layout attributes for a cell with an index path that does not exist #106

Open
glennschmidt opened this issue Nov 29, 2017 · 0 comments

Comments

@glennschmidt
Copy link

This crash has been occurring every now and then on iOS 10 and iOS 11.

Even though the backtrace doesn't specifically mention CalendarLib, it's the only part of my application which uses a UICollectionView so the crash is almost certain to have happened while laying out the calendar.

The fix might be as simple as adding an extra invalidateLayout call somewhere in the library, but I'm not sure.

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView received layout attributes for a cell with an index path that does not exist: <NSIndexPath: 0xc000000000000216> {length = 2, path = 2 - 0}'

Last Exception Backtrace:
0   CoreFoundation                       0x0000000184529d04 __exceptionPreprocess + 124
1   libobjc.A.dylib                      0x0000000183778528 objc_exception_throw + 52
2   CoreFoundation                       0x0000000184529bd8 +[NSException raise:format:arguments:] + 100
3   Foundation                           0x0000000184eb9c24 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 108
4   UIKit                                0x000000018d9bc29c __45-[UICollectionViewData validateLayoutInRect:]_block_invoke + 1788
5   UIKit                                0x000000018d9bb5f4 -[UICollectionViewData validateLayoutInRect:] + 1496
6   UIKit                                0x000000018d9baa34 -[UICollectionView layoutSubviews] + 256
7   UIKit                                0x000000018d95e2f8 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1272
8   QuartzCore                           0x0000000188517ec8 -[CALayer layoutSublayers] + 180
9   QuartzCore                           0x000000018851bfa8 CA::Layer::layout_if_needed(CA::Transaction*) + 328
10  QuartzCore                           0x000000018848aa98 CA::Context::commit_transaction(CA::Transaction*) + 332
11  QuartzCore                           0x00000001884b0eb4 CA::Transaction::commit() + 536
12  QuartzCore                           0x00000001884b1cf4 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 88
13  CoreFoundation                       0x00000001844d1848 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 28
14  CoreFoundation                       0x00000001844cf200 __CFRunLoopDoObservers + 408
15  CoreFoundation                       0x00000001844cf7bc __CFRunLoopRun + 1288
16  CoreFoundation                       0x00000001843effb8 CFRunLoopRunSpecific + 432
17  GraphicsServices                     0x0000000186287f84 GSEventRunModal + 96
18  UIKit                                0x000000018d9c42e8 UIApplicationMain + 204
19  MyApp                                0x0000000102ea3aac main (Constants.swift:22)
20  libdyld.dylib                        0x0000000183f1256c start + 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant