CSStickyHeaderFlowLayout: NSInternalInconsistencyException when scrolling to the bottom
Hi James.
I’m struggling with an issue… I’m using your library in a collection view, and I noticed that sometimes the system raises an NSInternalInconsistencyException when scrolling to the bottom. It looks like it’s correlated to the amount of cells displayed. I was able to recreate the issue in your sample, by providing only 2 sections, the first one with one item, the second one with 4. (You can find the sample in my fork).
Here’s the catch: it only happens when I compile with Xcode 5.1 on an iOS8 device (beta5). If I compile with Xcode6 everything goes smoothly. Given the circumstances it might not even be worth spending too much time fixing this, as it’s probably a bug introduced in the latest beta, but if someone with the current iOS8 beta downloads an app from the store with this component, it might crash.
Here’s the full stack trace:
2014-08-07 16:03:14.718 CSStickyHeaderFlowLayoutDemo[1538:270805]
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'layout attributes for supplementary item at index path (<NSIndexPath: 0x1a07c410> {length = 2, path = 1 - 0})
changed from <CSStickyHeaderFlowLayoutAttributes: 0x16d4a050> index path: (<NSIndexPath: 0x1a08e4c0> {length = 2, path = 1 - 0});
element kind: (UICollectionElementKindSectionHeader);
frame = (0 330; 320 50);
zIndex = 1024;
to <CSStickyHeaderFlowLayoutAttributes: 0x1a097e80> index path: (<NSIndexPath: 0x1a07c410> {length = 2, path = 1 - 0});
element kind: (UICollectionElementKindSectionHeader);
frame = (0 278.5; 320 50);
zIndex = 1024; without invalidating the layout'
anyway, thanks for your great work. 👍
Cheers.
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 17 (1 by maintainers)
Commits related to this issue
- ref #18 Toggle translucency of navigation bar to try replicate the problem — committed to CSStickyHeaderFlowLayout/CSStickyHeaderFlowLayout by jamztang 10 years ago
Add this to your viewDidLoad
Found by @chriscohoat here: https://github.com/CSStickyHeaderFlowLayout/CSStickyHeaderFlowLayout/issues/144
+1 (Swift)
I’ve to remove CSStickyHeaderFlowLayout only for this error!!! and use this: