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 crash in logs #46

Closed
rounak opened this issue Jan 5, 2015 · 10 comments
Closed

NSInternalInconsistencyException crash in logs #46

rounak opened this issue Jan 5, 2015 · 10 comments

Comments

@rounak
Copy link

rounak commented Jan 5, 2015

Fatal Exception: NSInternalInconsistencyException layout attributes for supplementary item at index path (<NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}) changed from <CSStickyHeaderFlowLayoutAttributes: 0x14e6a1ad0> index path: (<NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}); element kind: (CSStickyHeaderParallexHeader); frame = (0 0; 0 0); to <CSStickyHeaderFlowLayoutAttributes: 0x151865db0> index path: (<NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}); element kind: (CSStickyHeaderParallexHeader); frame = (0 -1.33333; 414 311.833); without invalidating the layout

Getting a lot of crashes like this with stacktrace:

4 UIKit 0x0000000186c3a87c __45-[UICollectionViewData validateLayoutInRect:]_block_invoke + 1004

5 UIKit 0x0000000186c39f74 -[UICollectionViewData validateLayoutInRect:] + 1492

6 UIKit 0x0000000186c397a0 -[UICollectionView layoutSubviews] + 160

@jamztang
Copy link
Collaborator

jamztang commented Jan 6, 2015

Do you know how to reproduce?

@jamztang
Copy link
Collaborator

jamztang commented Jan 6, 2015

It looks like the frame was changed from {0, 0, 0, 0} to something weird, how was your setup of the header?

@rounak
Copy link
Author

rounak commented Jan 6, 2015

I'm not really sure on how to reproduce as these are coming from crash logs, and the stack trace doesn't provide any hints really. My setup is a CSStickyHeader subclass at the top with other cells at the bottom.

@rounak
Copy link
Author

rounak commented Feb 17, 2015

Hey so when I change the value of parallaxHeaderReferenceSize, should I invalidate the layout? Even if I change it in viewDidLoad?

@jamztang
Copy link
Collaborator

Changing parallaxHeaderReferenceSize sounds reasonable to invalidate the layout. Would viewDidLoad will still have chance more than once after iOS 6?

@rounak
Copy link
Author

rounak commented Feb 17, 2015

What if in viewDidLoad, I'm setting parallaxHeaderReferenceSize just once?

@jamztang
Copy link
Collaborator

I'll be checking the doc for viewDidLoad to see if there's any hints.
So for whom is not aware, calling invalidLayout after changing parallaxHeaderReferenceSize seemed to solve the problem, I'll submit a patch soon, thanks @rounak for the heads up!

@rounak
Copy link
Author

rounak commented Feb 25, 2015

👍 Thanks for all your work @jamztang!

@jamztang
Copy link
Collaborator

Thanks @rounak. I'm checking out other issues and see if there's any more things I can squash into this update before pushing a new version :)

@harryworld
Copy link

@jamztang It happens to me in Simulator, but not in device

Simulator: Xcode 6.2 / iOS 8.2
Device: iPhone 6 / iOS 8.2

After doing a pod update, it disappears (without clean up or removing the app from Simulator)

Downloading dependencies
Installing AFNetworking 2.3.1 (was 2.3.1)
Installing Appsee 2.1.3 (was 2.1.2)
Installing Bolts 1.1.4 (was 1.1.3)
Installing CSStickyHeaderFlowLayout 0.2.4 (was 0.2.4)
Installing DZImageEditing 1.0.0 (was 1.0.0)
Installing DZNEmptyDataSet 1.5.2 (was 1.4.1)
Using DZNPhotoPickerController (1.5)
Installing DateTools 1.5.0 (was 1.5.0)
Installing Facebook-iOS-SDK 3.23.2 (was 3.21.1)
Installing POP+MCAnimate 2.0.1 (was 2.0.1)
Installing Reachability 3.2 (was 3.2)
Installing SDWebImage 3.7.2 (was 3.7.1)
Installing UIActivityIndicator-for-SDWebImage 1.2 (was 1.2)
Installing pop 1.0.7 (was 1.0.7)
Generating Pods project
Integrating client project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants