Gauthier Beignie
Gauthier Beignie

Reputation: 161

tableView didSelectRowAtIndexPath doesn't work correctly

I have a really strange problem. I have a UITableView in a view controller, I can customize all that I want it works. But I want that when I click on a row an other view appear (it is not difficult), so I have done that:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"didSelectRowAtIndexPath");
    self.myFicheView.hidden=NO;

    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

But when I click on a row the method is not called. Like it doesn't work I have tried many things and I have found something strange. When I click briefly on the row nothing happen, but when I click during 3 seconds it work and when I slide my finger on the row too.

Somebody know what is the problem here ?

@interface MapViewController : UIViewController<UITableViewDelegate,UITableViewDataSource>
{

}
@property (strong, nonatomic) IBOutlet UITableView *myTableView;

here the connections inspector of my tableView http://hpics.li/256d01e

Upvotes: 1

Views: 1002

Answers (2)

Rahul Mathur
Rahul Mathur

Reputation: 882

I exactly have no idea how your xib looks like, assuming if the view is coming somewhere in front of your table view, try to bring your tableview in front to that unhidden view.

Assuming if you have put [tableView deselectRowAtIndexPath:indexPath animated:YES]; method only to unhide the selection then there is a property in xib which provides you this facility, by using this you can remove this method and try to run your code. Please give a snapshot of your xib or some of your implemented code for better clarification.

Upvotes: 2

Albin Joseph
Albin Joseph

Reputation: 1141

I think you will not call the delegate method

plz include this code to your viewDidLoad method

myTableView.delegate=self;
myTableView.dataSource=self;

Upvotes: 1

Related Questions