En ios7 tableView: didSelectRowAtIndexPath: no se llama

I meagrate my project to adjust ios7 while I encountered a strange problem : the delegate method "tableView:didSelectRowAtIndexPath:" is not called in ios7 ,it works well in prior ios version.I was wonder if some specific property be changed in ios7 Here is the code:

- (void)viewDidLoad {
    [super viewDidLoad];

    [self.tableView setDelegate:self];
    [self.tableView setDataSource:self];
    [self.tableView setAllowsMultipleSelection:NO];
    [self.tableView setMultipleTouchEnabled:NO];

}

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

    [sender deselectRowAtIndexPath:indexPath animated:YES];

    _currentContact = [contactArr objectAtIndex:indexPath.row];
    if ([_currentContact.accountNPC hasPrefix:@"0"]) {
        isContactToNPC = NO;
    }else{
        isContactToNPC = YES;
    }

    ....
}

preguntado el 23 de septiembre de 13 a las 04:09

Have you confirmed to UITableViewDelegate,UITableViewDataSource in .h file ? -

Are you using custom cells in UITableViewCell ? -

@NANNAV : Does it matter that he uses customcell or default tableviewcell? because in both the condition didSelectRowAtIndexPath must be called. -

@D-eptdeveloper if custom cell have tapgesture it not called -

@passol Is this occurs only in iOS 7 ? -

2 Respuestas

Add the following in your viewController.h file

 <UITableViewDelegate,UITableViewDatasource> 

also connect the tableview's delegate and datasource to the File's Owner of .xib

Respondido el 23 de Septiembre de 13 a las 05:09

I'm sorry,I found the answer I just need set

[cell setExclusiveTouch:YES]

Tks @abhishekkharwar de https://stackoverflow.com/a/18826264/2396477

contestado el 23 de mayo de 17 a las 13:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.