didSelectRowAtIndexPath: not being called
I have found the answer. I had a UITapGestureRecognizer set for myTableView's superView. This overrode the selection call. Credit to whoever suggested that that might be it. Your answer was deleted before I could mark it correct.
Set the cancelsTouchesInView
property to NO
on the gesture recogniser to allow the table view to intercept the event.
Updated for Swift 3:
if you are used UITapGestureRecognizer in your code :- # Swift 3 use below lines of code:
extension YourViewController{
func hideKeyboardWhenTappedAround() {
let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(YourViewController.dismissKeyboard))
view.addGestureRecognizer(tap)
tap.cancelsTouchesInView = false
}
func dismissKeyboard() {
view.endEditing(true)
}
}
How to called:- In ViewDidLoad()
self.hideKeyboardWhenTappedAround()
Your problem is case-sensitivity. Your code:
- (void)tableVIew:(UITableView *)tableView didSelectRowAtIndexPath: (NSIndexPath *)indexPath {
should be
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath: (NSIndexPath *)indexPath {