Creign
Creign

Reputation: 134

Error in UICollectionView reloadData

What I do: rootVC —> modalView1 —> modalView2 —> modalView3 —> dismiss modalView3 to rootVC then reload collectionView

the collectionView is in the rootVC.

This is the code for going back to rootVC: self.view.window!.rootViewController?.dismiss(animated: true, completion: nil)

dismissing to rootVC is working but error occurs during collectionView.reloadData()

enter image description here

Thanks in advance!

Upvotes: 0

Views: 81

Answers (1)

Xi_Wong
Xi_Wong

Reputation: 1

First, the error message is "found nil", so, in this code, collectionView is nil, you can find the content of collectionView, such as tag, button or label, something in content must do not connect the collectionView.

Upvotes: 0

Related Questions