reloadData in didSelectRowAtIndexPath with deselectRowAtIndexPath:animated:YES

Discussion in 'iPhone/iPad Programming' started by xinevil, Apr 13, 2009.

  1. macrumors newbie

    #1
    I have an UITableView which allows selection. After selecting a row, the second section must be reloaded, so I run a [tableView reloadData].
    But the problem is that in the "- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath"-function, I do a "[tableView deselectRowAtIndexPath:indexPath animated:YES];".
    When the data is reloaded, my cell gets deselected immediately, and I don't see the animation. Is there a way to fix this?
     
  2. macrumors demi-god

    #2
    This certainly isn't the best solution, but use a Timer? Deselect with animation, wait x amount of time (second? two seconds?) then reload the data?
     
  3. macrumors newbie

    #3
    Yeah I have that now. The strange thing is, even with a timer of 0.001 seconds it works as it should :confused: .
     

Share This Page