Force UITableView pour faire défiler vers le haut?

Comment feriez-vous forçant un UITableViewCell pour faire défiler vers le haut si la tableview contient moins de 10 ou si les cellules? J'ai en charge la modification de l'Objet Géré Contextes dans mon tableView de cellules, tandis que la tableview est en mode d'édition. Inutile de dire que, si une cellule est au bas de la tableview, il devient bloqué par le clavier lorsqu'un utilisateur accède à modifier le titre ou le lieu d'un événement. J'ai essayé une solution comme:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:NO];

    if(_selectedIndex == indexPath.row){
        _selectedIndex = -1;
        [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
                         withRowAnimation:UITableViewRowAnimationFade];
        return;
    }

    if(_selectedIndex >= 0){
        NSIndexPath *previous = [NSIndexPath indexPathForRow:_selectedIndex inSection:0];
        _selectedIndex = indexPath.row;
        [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:previous]
                         withRowAnimation:UITableViewRowAnimationFade];
    }

    _selectedIndex = indexPath.row;
    [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
                     withRowAnimation:UITableViewRowAnimationFade];

    [tableView setContentOffset:CGPointMake(0, [tableView rowHeight]*indexPath.row) animated:YES];
}

Mais cela n'empêche pas la tableview à la contentOffset. il sautera vers le haut, puis snap back

OriginalL'auteur HighFlyingFantasy | 2012-06-29