Open roblabs opened 2 years ago
Also while researching, we found this comment at https://developer.apple.com/forums/thread/694494?answerId=696680022#696680022 with our emphasis added
With the information provided here, my best guess is that you are registering one element kind but then return another element kind. I.e. the element kind passed to you in
viewForSupplementaryOfKind:
is not the same element kind that is set on the cell when you return it / the identifier of what you are dequeuing is associated with a different element kind during registration of that class. This is an issue as it completely breaks reusability, so starting in iOS 15 this case is detected and asserted.
FB9812333
Uncaught exception
NSInternalInconsistencyException
while reviewing Apple Sample Code for iMessage apps.There is a similar discussion found at iOS 15 crash at -collectionView:viewForSupplementaryElementOfKind:atIndexPath: on the Apple Developer Forums.
Expected
iOS 15.2 does not crash with Apple Sample Code.
Steps to reproduce
README-NSInternalInconsistencyException.png
Terminating app due to uncaught exception '![README-NSInternalInconsistencyException](https://user-images.githubusercontent.com/118112/146592495-a5b20de2-0ee0-4917-badd-fb76454efb6c.png)
NSInternalInconsistencyException
iOS 14.4 simulator works
While completing the same steps in an iOS 14.4 simulator, the Apple Sample code works.