I found the answer on another StackOverflow question.
I had a UITapGestureRecognizer
added to [self view]
which I commented out, and then the delegate method worked.
Can anyone please tell me why this worked and also how I can get the UITapGestureRecognizer
working on the same screen as the UITableView
?
// Hide keyboard when user taps outside of it
UITapGestureRecognizer *tapGestureRecognizer =
[[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(hideKeyboardOnTap)];
//[[self view] addGestureRecognizer:tapGestureRecognizer];
- EDIT: Corrected typo of
UITapeGestureRecognizer
toUITapGestureRecognizer