실제로 나는 다른 셀로 이동하기 위해 다음 및 이전 버튼을 사용하고 있으며 각 셀에는 텍스트 필드가 있으므로 다음 버튼을 누르면 다음 셀로 이동하고이 셀 참조를 가져 와서 텍스트 필드를 만들 수 있습니다. 첫 번째 응답자하지만 이전 버튼을 클릭하면 참조가 반환됩니다. 난 다음 및 이전을 위해 사용하고 코드는UITableViewCell에있는 UITextField에 대한 참조를 얻고 싶습니까?
- (IBAction)nextPrevious:(id)sender
{
NSIndexPath *indexPath ;
BOOL check = FALSE;
if([(UISegmentedControl *)sender selectedSegmentIndex] == 1){
if(sectionCount>=0 && sectionCount<8){
//for next button
check = TRUE;
sectionCount = sectionCount+1;
indexPath = [NSIndexPath indexPathForRow:0 inSection:sectionCount];
}
}else{
//for previous button
if(sectionCount>0 && sectionCount<=9){
check = TRUE;
sectionCount = sectionCount-1;
indexPath = [NSIndexPath indexPathForRow:0 inSection:sectionCount];
}
}
if(check == TRUE){
//[registrationTbl reloadData];
UITableViewCell *cell = [registrationTbl cellForRowAtIndexPath:indexPath];
for(UIView *view in cell.contentView.subviews){
if([view isKindOfClass:[UITextField class]]){
[(UITextField *)view becomeFirstResponder];
break;
}
}
[registrationTbl scrollToRowAtIndexPath:indexPath
atScrollPosition:UITableViewScrollPositionTop
animated:YES];
// UITextField *field = (UITextField *) [cell.contentView viewWithTag:indexPath.section];
// [field becomeFirstResponder];
}
아래에 주어진 모든 작은 제안을 많이 이해할 수있을 것이다. 미리 감사드립니다.
고맙습니다, 감사합니다. 대단히 감사합니다. 그것은 나를 위해 일했습니다. –