在UITableViewCell中返回null UITextView标记

时间:2012-05-15 14:40:59

标签: iphone objective-c uitextfielddelegate

我在UITableViewCell中放置了10个UITextField,并在每个UITextField上放置了标签。

我的问题是,我可以在

中访问那些UITextField的标签吗?
- (void)textFieldDidBeginEditing:(UITextField *)textField?

1 个答案:

答案 0 :(得分:1)

  

我的问题是,我可以访问那些UITextFields的标签吗?   -(void)textFieldDidBeginEditing:(UITextField *)textField

不确定。只需使用:

textField.tag

为特定字段调用方法textFieldDidBeginEditing:,该字段将在textField参数中指定。如果要访问不同的字段,则需要获取指向所需字段的指针。你可以这样做:

UIView *parent = [textField superview];
UITextField *someOtherField = [parent viewWithTag:theTagOfTheFieldYouWant];