En ios7 tableView: didSelectRowAtIndexPath: no se llama
Frecuentes
Visto 3,578 veces
1
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;
}
....
}
2 Respuestas
0
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
0
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 iphone ios ios7 or haz tu propia pregunta.
Have you confirmed to UITableViewDelegate,UITableViewDataSource in .h file ? - Prashant Nikam
Are you using custom cells in UITableViewCell ? - NANNAV
@NANNAV : Does it matter that he uses customcell or default tableviewcell? because in both the condition didSelectRowAtIndexPath must be called. - D-eptdeveloper
@D-eptdeveloper if custom cell have tapgesture it not called - NANNAV
@passol Is this occurs only in iOS 7 ? - Venk