Reputation: 1280
I have a uitableview with custom uitableviewcells. Trying to perform a segue from each cell, something strange happens.
I have traced the code with an NSLog to know what is happing (showing each cell textname), and if I click over a cell, the log is not showed, and If I click in other cell after , the logs displays the previously cell clicked textname.
Note that I have many sections created programmatically. So I have many Arrays, one for each section. The uitableview is into a container.
- (void) tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath{
switch (indexPath.section) {
case 0:
NSLog(@"Cell: %@",[opcionesEstado objectAtIndex:indexPath.row]);
break;
case 1:
NSLog(@"Cell: %@",[opcionesPersonajes objectAtIndex:indexPath.row]);
break;
case 2:
NSLog(@"Cell: %@",[opcionesNoticias objectAtIndex:indexPath.row]);
break;
case 3:
NSLog(@"Cell: %@",[opcionesAjustes objectAtIndex:indexPath.row]);
break;
case 4:
NSLog(@"Cell: %@",[opcionesLogout objectAtIndex:indexPath.row]);
break;
}
}
Upvotes: 0
Views: 94
Reputation: 3526
The problem is you use didDeselectRowAtIndexPath. And you should use didSelectRowAtIndexPath.
Upvotes: 1