Terminating app due to uncaught exception \'NSGenericException\'
Terminating app due to uncaught exception \'NSGenericException\', reason: \'Unable to
I got this problem using a UIPickerView like input of a UITextField (using Autolayout). When I push another viewController and thus a pop it to the viewController with the picker, the app crashes. I found the following solution, in the UIPickerViewController:
-(void)viewWillAppear:(BOOL)animated{
[self.pickerView removeFromSuperview];
[self.pickerView setTranslateAutoresizingMaskIntoContraints:YES];
[self.view addSubview];
}
You can also set the UIPickerViewPosition after removing from superview. I hope that can help you!