he scope is to have my keyboard dismissed when I press the addFirstOption related button.
This IBAction is a UIButton call in MainViewController. firstOption
is a property IBOutlet UITextField.
The runtime crashes when it reaches [self.firstOption resignFirstResponder]
.I tried [self.firstOption isFirstResponder]
and [self.firstOption canResignFirstResponder]
for a crosscheck and in both care I get a BOOL YES which make sense...
I did very similar and more simple code with the same input and resignFirstResponder and they all worked.
- (IBAction)addFirstOption:(UIButton *)sender { NSString *firstOptionName = [[self firstOption]text]; Option *userOption1 = [[Option alloc]init]; userOption1.name = firstOptionName; [self.firstOption resignFirstResponder];}