didSelectRowAtIndexPath is not working

In my app I want to catch reactions from my UITableView but I do not why it doesn't work:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

I defined the delegate

@interface TableViewController : UIViewController <UITableViewDelegate>

I ticked the "user interaction enable" from the nib file showed the delegate to the files owner.

I also write tableView.delegate = self; to the viewDidLoad. What am I missing?


Set the datasource for your table. Put some data in the table n then see if the delegate is called. If it still doesn't then, usually the problem with delegate not getting called is that its not getting set properly.! so, double check your code..:)

Try making the delegates connection in the IB. and check that you declare this:UITableViewDataSource

along with UITableViewDelegate.

Be sure you have the UITableViewDataSource delegate in your header as well.

Need Your Help

Help with refactoring to an Action<T> delegate

c# generics refactoring

In a test method (for a Fluent NHibernate mapping, although that's not really relevant) I have the following code wrapped in a bunch of usings and try/catch blocks: