I have a problem in my app and can t find a solution.
I have a UICollectionView with custom cells. My cells have a UITextField inside.
When textfield is in editMode (with the keyboard active), if i reload the collectionView i have a EXC_BAD_ACCESS error. This error happen because the call of the method resignFirstResponder of the UITextField. The problem is the cell probably don´t exist anymore inside the collectionView, since it was dealloced.
This is my stack on the error:
Any idea how to avoid this problem?
Thanks in advance
Add a reference in the model to the textfield, weak reference.
When the model will be dealloc, resign the responder of the textfield.
Code: