Post

Replies

Boosts

Views

Activity

Reply to Crash in iOS18
I am gettin same error but I cant figure out whats wrong here. The above solutions dont even apply because I have only 1 cell to dequeue. It was working until I upgraded to iOS 18 / Xcode 16 I am using UICollectionViewCompositionalLayout for estimated height and 1.0 fractional width. Theres only 1 section in the collection view with 7 items in that section. And again, only one line of collectionView.dequeueReusableCell. When I run, the first two cell display fine, but the moment I scroll to load more cells, its breaks with below error. Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expected dequeued view to be returned to the collection view in preparation for display. When the collection view's data source is asked to provide a view for a given index path, ensure that a single view is dequeued and returned to the collection view. Avoid dequeuing views without a request from the collection view. For retrieving an existing view in the collection view, use -[UICollectionView cellForItemAtIndexPath:] or -[UICollectionView supplementaryViewForElementKind:atIndexPath:]
Sep ’24