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 when scrolling to the bottom #18
Comments
Thanks for reporting Andrea, In fact I'm not really sure what cause the problem at this moment, I was hoping #15 had fixed the crash. I'll keep an eye on it, if couldn't find anything wrong, hopefully when iOS 8 stables it could resolve itself. |
I've had the same issue recently pretty consistently on Xcode GM iOS 8:
Any ideas on what is causing this?? |
I'm seeing the same thing.... |
So I'm using Xcode 6 GM, looking at it seems the fork from @andreamazz doesn't reproduce the warning again. |
@jamztang I think we found the issue. The crash comes when the translucent property of the navigation bar is toggled.
If you change the translucent property of the UINavigationBar as you navigate the UINavigationController the offset of the UICollectionView changes (if not translucent the offset is 0, if translucent its -64) and causes the Inconsistency when the header attributes are getting created and are laying out. To ensure that it doesn't crash you need to make sure that translucent property of the UINavigationBar is the same when you enter/exit the UIViewController that has your UICollectionView. |
@jacobmoncur didn't quite able to reproduce the problem. Do you toggle translucent in viewWillAppear? |
Also getting a similar issue when attempting to get an index path of a targetContentOffset. i.e:
and I get:
|
Still no solution? |
I tried @andreamazz branch again but I am not able to reproduce the problem. I didn't have a chance to setup or replicate the proper testing environment that triggers the bug yet, if there's any help would be highly appreciated. |
Looks like that compiling with the latest SDK solves the issue, right now I can't reproduce the crash either. |
Great so lets close this for now and until there're new issues arise. |
I get same issue when implementing timeline layout and I fix it. I can reproduce the issue in my demo easily. Actually, the exception has told us what happen. When scrolling to bottom, people always continue to scroll to beyond the contentSize and CollectionView will go back. In the process, layout system will call |
hey i am having some issue with the indexpath creating please help indexPath = [NSIndexPath indexPathForItem:1 inSection:1]; |
any real solution on this? 2 years later and this is still happening. |
iOS 10 beta2, happen this problem |
+1 (Swift) I've to remove CSStickyHeaderFlowLayout only for this error!!! if #available(iOS 9.0, *) {
(collectionView.collectionViewLayout as! UICollectionViewFlowLayout).sectionHeadersPinToVisibleBounds = true
}
self.automaticallyAdjustsScrollViewInsets = false func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
let width = floor((collectionView.frame.size.width - 1.0) / 2.0)
return CGSize(width: width, height: width)
}
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize {
let width = floor(collectionView.frame.size.width)
return CGSize(width: width, height: 50)
}
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAtIndex section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
}
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAtIndex section: Int) -> CGFloat {
return 1.0
}
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAtIndex section: Int) -> CGFloat {
return 1.0
} |
Add this to your viewDidLoad
Found by @chriscohoat here: #144 |
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:
anyway, thanks for your great work. 👍
Cheers.
The text was updated successfully, but these errors were encountered: