When I touch on a text field called tv_Name
, it brings up the keypad but then, when I touch outside the keypad, the program crashes.
In ViewController.h
, I have declared it thus:
@property (weak, nonatomic) IBOutlet UITextField *tv_Name;
and this is the code for hiding keypad in ViewController.m
:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[self.tv_Name resignFirstResponder];
}
The code immediately above throws an exception:
**2013-12-21 13:09:36.027 HerdProfile[818:70b] -[HerdProfileViewController tv_Name:]: unrecognized selector sent to instance 0x10901ce90 (lldb)**