I added textfield to tableview cell contentview.when i'm editing any textfield and i scrolled the tableview to bottom and dismiss the keyboard Then app crashed ,because of this reason [UITableViewCell _didChangeToFirstResponder:]: message sent to deallocated instance
Try to hide the keyboard while scrolling.
In h class Declare a textfield
UITextField *selectedTextField;
In m class
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
selectedTextField = textField;
return YES;
}
I also had the same problem. The above solution fixed it.
All the best.
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
[selectedTextField resignFirstResponder];
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With