Reputation: 1067
My table view returns the row on unSelect instead of onSelect, so when I select the first cell didDeselectRowAtIndexPath return nothing, but when I select other cell I get the unselecting cell row instead of the one select. Working backwards?
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
{
//NSLog(@"%i", indexPath.row);
_myLabel.text = [myDataArray objectAtIndex:indexPath.row];
}
Upvotes: 0
Views: 738
Reputation: 525
Use didSelectRowAtIndexPath method instead of didDeselectRowAtIndexPath.
Upvotes: 0
Reputation: 4513
You are doing it wrong. You are using didDeselectRowAtIndexPath
instead of didSelectRowAtIndexPath
method. If you want to select a particular row on tap, you will need to use didSelectRowAtIndexPath
.
Upvotes: 3