views:

10

answers:

0

I have a quick, probably basic question regarding UITableView in iOS. I'm trying to insert a row at the end of my table. It works with every animation except UITableViewRowAnimationBottom. If I specify this particular animation, the cell appears at the end of the table, rather than animating.

My code is essentially as follows:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

    //Update Model
    [cardArray insertObject:@"New Row" atIndex:0];

    //Get index of next row
    NSIndexPath *nextIndexPath = [NSIndexPath indexPathForRow:indexPath.row+1 inSection:0];

    //Insert New Row
    [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:nextIndexPath]
                          withRowAnimation:UITableViewRowAnimationBottom];


}

Any help is greatly appreciated. I'm probably getting something very simple wrong, but I've been scratching my head for a while.