I have a UITableViewController
with custom UITableViewCell
. Where each cell contains a UITextField
. Now what i want is to shift the control from one text field to the every next text field when return key is pressed.
what i m thinging to do is this...
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
NSIndexPath *currentIndexPath=[self.tableView indexPathForCell:(UITableViewCell*)textField.superview.superview];
if(currentIndexPath.row<_excerciseData.totalBlanks-1){
NSIndexPath nextIndexPath=???
UITextField *nextTextFeild=[(UITableViewCell*)[self.tableView cellForRowAtIndexPath:nextIndexPath] viewWithTag:2];
[nextTextFeild becomeFirstResponder];
}else{
[textField resignFirstResponder];
}
return YES;
}
but for this i don't know, how to find the indexPath of very next UITableViewCell
. Can anybody help me to find this? this... :)