私のUITableViewCellには、ユーザーが行をクリックするたびに180度回転したいUIImageViewがあります(didSelectRowAtIndexPath:)。コードは非常に単純です:
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *curCell = [self.tableView cellForRowAtIndexPath:indexPath];
UIImageView *imgArrow = (UIImageView*)[curCell viewWithTag:3];
[UIView animateWithDuration:0.3 animations:^{imgArrow.transform = CGAffineTransformMakeRotation(M_PI);}];
}
問題は、これが常に1回だけ発生することです。ユーザーが最初にセルをクリックすると、imgArrowは適切に回転しますが、セルを2回クリックしても元に戻りません。なぜ?
手伝ってくれてありがとう!