5

this is the second time I posted here about this issue and no one could help me my project was good in iOS 14 and previous versions when I debug my app on simulator or real device that have iOS 15 the collectionView disappear while scrolling or until the collectionView disappear from seen , when the collectionViews disappear this show me in debugger

myPorjectiOS[21684:5460574] [Assert] UITableView internal inconsistency: cell prefetched for IP(3,0) already stored for IP(3,0). Cell: <myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>; Prefetched Cells: {
    "<NSIndexPath: 0xa51756da222d5115> {length = 2, path = 3 - 0}" = "<myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>";
t] UITableView internal inconsistency: cell already prefetched for IP(3,0). Existing: <myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>; New: <myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>; Prefetched Cells: {
    "<NSIndexPath: 0xa51756da222d5115> {length = 2, path = 3 - 0}" = "<myPorjectiOS.DashboardSectionTwoTableItem: 0x136307200; baseClass = UITableViewCell; frame = (0 149; 375 150); autoresize = W; layer = <CALayer: 0x28064e7c0>>";

and this show me only when running the app in iOS 15

cellForItemAt

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: R.reuseIdentifier.dashboardSectionTwoCollectionItem.identifier, for: indexPath) as? DashboardSectionTwoCollectionItem
        let object = self.object[indexPath.row]
        cell?.bind(object)

        //fixing  the hiding CollectionViews
        
        return cell!
    }

I tried to add self.collectionView.reloadData() before return cell! it fix my problem but the view was laggy and I can't tap on my content

this is my setupUI

func setupUI(){
        self.collectionView.delegate = self
        self.collectionView.dataSource = self
        
        collectionView.register(UINib(resource: R.nib.dashboardSectionTwoCollectionItem), forCellWithReuseIdentifier: R.reuseIdentifier.dashboardSectionTwoCollectionItem.identifier)

    }
    func bind(_ object:[GenresModel.Datum]){
        self.object = object
        self.collectionView.reloadData()
    }
Joseph
  • 53
  • 4
  • 2
    I am also getting this error. My UI structure is a table view, where some of the cells contain collection views. It is these cells that are generating this error. – Siegfoult Jun 09 '22 at 18:14
  • I had NSAttributed strings from html (NSAttributedString.DocumentType.html) inside UICollectionViewCell + UITableViewCell, which caused disappearing error from time to time. Removed NSAttributedString = no error – demensdeum Jul 27 '22 at 13:57
  • How was this solved, please it would be very appreciated. – Eddy Aug 11 '22 at 20:27
  • We are also getting this issue, please help. – Bankim Sep 19 '22 at 12:34

0 Answers0