2012-05-15 3 views
0

UITableViewCell 안에 10 개의 UITextField를 넣고 모든 UITextField에 태그를 넣습니다.return null UITableViewCell의 UITextView 태그

내 질문은 내가 -(void)textFieldDidBeginEditing:(UITextField *)textField에 그 UITextFields의 태그에 액세스 할 수 있습니다, 내 질문은 내가

- (void)textFieldDidBeginEditing:(UITextField *)textField? 
+1

그냥 textField.tag를 사용 하시겠습니까? – Rengers

답변

1

에 그 UITextFields의 태그를 액세스 할 수있다?

확실히. 그냥 사용

textField.tag 

방법 textFieldDidBeginEditing:은 특정 필드라고하며, 그 필드는 textField 매개 변수에 지정됩니다. 다른 필드에 액세스하려는 경우 원하는 필드에 대한 포인터를 가져와야합니다. 당신은 다음과 같이 할 수 있습니다 :

+0

코드는 다음과 같다 :   - (있는 UITableViewCell *)를 tableView (jQuery과 *)를 tableView cellForRowAtIndexPath (NSIndexPath *) indexPath { ... INT를 rowCount = indexPath.row; NavigationObject * navigationObj = [self.navigations objectAtIndex : rowCount]; cell.cellWayPoint.text = navigationObj.waypoint; cell.cellWayPoint.tag = indexPath.row; cell.cellWayPoint.delegate = self; 반환 셀; } –

+0

- (void) textFieldDidBeginEditing : (UITextField *) textField { NSLog (@ "현재 편집중인 텍스트 필드 : % @", textField.tag); [self animateTextField : textField up : YES]; } –

+0

그리고 null을 반환합니다. –