Changing the inputview property of a UITextView to nil leades tp app crash

143 Views Asked by At

I am trying to reopen system keyboard on dismissing date picker. I have written code as:

[self.textView resignFirstResponder];
if ([self.textView.inputView isEqual:self.datePicker]) {
        //Display the keyboard
        self.textView.inputView = nil;
}
else {
        self.textView.inputView = self.datePicker;
}
[self.textView becomeFirstResponder];

But with this code app crashes and if I comment self.textView.inputView = nil; this line then I am not able to get back my system keyboard and dismiss date picker.

0

There are 0 best solutions below