how to scroll the table on the click event of a cell in objective c?

advertisements

I am right now working with one application where i need to take one uitableview with uilable and textfield in each cell.I am able to scroll the table manually once the user starts writing, but what i want is that when i click on the textfield,the table should scroll upward so that the user is able to see what he has entered in the textfield.Same thing i saw once i logged in the iphone facebook.

this is the code for manually scrolling the table :

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 250;
}

-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    CGRect viewRect    = CGRectMake(0, 0, 320, 160);
    UIView *footerView = [[UIView alloc] initWithFrame:viewRect];
    return footerView;
}

Is there any way around?

Thanks in advance.


This post describes what you want to achieve. Also see this tutorial which nicely describes how to solve this problem.

Happy coding & happy new year