Whenever my popover is dismissed by touching in another view when keyboard is shown for a UITextField, my app crashes with this error –
[NSISObjectiveLinearExpression coefficientForVariable:]: unrecognized selector sent to instance 0x1cd93850
I’ve found this post, explaining that I should endEditing in viewWillDisappear, but it didn’t help, while debugging it crashes before even getting to viewWillDisappear.
I’ve found that
popoverControllerShouldDismissPopoveris called at theUIPopoverViewControllerDelegatebefore the crash, so I’ve plantedendEditingover there and it worked.This is the delegate’s code –